edu.harvard.hul.ois.jhove.module.pdf
Class XProfileBase

java.lang.Object
  extended by edu.harvard.hul.ois.jhove.module.pdf.PdfProfile
      extended by edu.harvard.hul.ois.jhove.module.pdf.XProfileBase
Direct Known Subclasses:
X1aProfile, X1Profile, X2Profile, X3Profile

public abstract class XProfileBase
extends PdfProfile

Abstract base class for PDF profilers of the PDF/X family. See ISO Standard 15930-1, "Complete exchange using CMYK data (PDF/X-1 and PDF/X-1a)"


Field Summary
protected  boolean _bleedBoxPresent
          Set to true if a BleedBox is found.
protected  int _xType
          PDF-X type used by the subclass.
static int PDFX1
          Enumerated values for PDF-X type
static int PDFX1A
          Enumerated values for PDF-X type
static int PDFX2
          Enumerated values for PDF-X type
static int PDFX3
          Enumerated values for PDF-X type
 
Fields inherited from class edu.harvard.hul.ois.jhove.module.pdf.PdfProfile
_module, _parser, _profileText, _raf
 
Constructor Summary
XProfileBase(PdfModule module, int xType)
          Constructor.
 
Method Summary
protected  boolean bboxOK(boolean requireMediaBox)
          Checks all the page objects for bounding boxes.
protected  boolean checkPrefsAgainstBleedBox()
          Checks ViewerPreferences dictionary against MediaBox and BleedBox.
protected  boolean extGStateOK(PdfDictionary gs)
          Checks if the ExtGState resource meets profile requirements.
protected  boolean filterOK(PdfObject filters, boolean forbidLZW, boolean forbidJBIG2)
          Checks for forbidden filters in a Filters dictionary.
protected  boolean formObjectOK(PdfDictionary fo)
          Checks the conformance of a form XObject.
protected  boolean imageObjectOK(PdfDictionary xo)
          Checks if a single image XObject fits the profile
protected  boolean infoDictOK(java.lang.String xVersion)
          Checks if the entries which are required in the document information dictionary by PDF-X/1 and X/3 are there.
protected  boolean isBleedBoxPresent()
          Returns true if a BleedBox has been detected.
protected  boolean outputIntentsOK(PdfArray intents)
          Checks if the OutputIntents of this document conform to profile requirements.
protected  boolean trailerDictOK()
          Checks profile requirements on the trailer dictionary.
protected  boolean xObjectOK(PdfDictionary xo)
          Checks a single XObject for xObjectsOK.
 
Methods inherited from class edu.harvard.hul.ois.jhove.module.pdf.PdfProfile
getText, hasFilters, isAlreadyOK, satisfiesProfile, satisfiesThisProfile, xObjectsOK
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDFX1

public static int PDFX1
Enumerated values for PDF-X type


PDFX1A

public static int PDFX1A
Enumerated values for PDF-X type


PDFX2

public static int PDFX2
Enumerated values for PDF-X type


PDFX3

public static int PDFX3
Enumerated values for PDF-X type


_xType

protected int _xType
PDF-X type used by the subclass.


_bleedBoxPresent

protected boolean _bleedBoxPresent
Set to true if a BleedBox is found.

Constructor Detail

XProfileBase

public XProfileBase(PdfModule module,
                    int xType)
Constructor. Creates an X1Profile object for subsequent testing.

Parameters:
module - The module under which we are checking the profile.
xType - The type of PDF/X profile being checked
Method Detail

infoDictOK

protected boolean infoDictOK(java.lang.String xVersion)
Checks if the entries which are required in the document information dictionary by PDF-X/1 and X/3 are there. These entries are optional under the PDF specification, so they must be checked here.


isBleedBoxPresent

protected boolean isBleedBoxPresent()
Returns true if a BleedBox has been detected.


outputIntentsOK

protected boolean outputIntentsOK(PdfArray intents)
Checks if the OutputIntents of this document conform to profile requirements. There must be exactly one entry in the dictionary which has a subtype of GTS_PDFX.


trailerDictOK

protected boolean trailerDictOK()
Checks profile requirements on the trailer dictionary.


extGStateOK

protected boolean extGStateOK(PdfDictionary gs)
Checks if the ExtGState resource meets profile requirements. It may not have TR, TR2, or HTP entries.


xObjectOK

protected boolean xObjectOK(PdfDictionary xo)
Checks a single XObject for xObjectsOK. Calls imageObjectOK and formObjectOK for profile-specific functionality.

Overrides:
xObjectOK in class PdfProfile

imageObjectOK

protected boolean imageObjectOK(PdfDictionary xo)
Checks if a single image XObject fits the profile


formObjectOK

protected boolean formObjectOK(PdfDictionary fo)
Checks the conformance of a form XObject. Does nothing; must be overridden if there are conditions on such forms.


bboxOK

protected boolean bboxOK(boolean requireMediaBox)
Checks all the page objects for bounding boxes. If requireMediaBox is true, each page has to include or inherit a MediaBox. Each page must include one but not both of a TrimBox and an ArtBox.


checkPrefsAgainstBleedBox

protected boolean checkPrefsAgainstBleedBox()
Checks ViewerPreferences dictionary against MediaBox and BleedBox. In PDF-X1/a and X2, if a BleedBox is present and if the ViewerPreferences dictionary contains the ViewClip, PrintArea or PrintClip keys, each of those keys present shall have the value MediaBox or BleedBox. This must be called after bboxOK has checked if any BleedBoxes are found.


filterOK

protected boolean filterOK(PdfObject filters,
                           boolean forbidLZW,
                           boolean forbidJBIG2)
Checks for forbidden filters in a Filters dictionary.