Class AbstractXObjValidator
java.lang.Object
org.apache.pdfbox.preflight.xobject.AbstractXObjValidator
- All Implemented Interfaces:
XObjectValidator
- Direct Known Subclasses:
XObjFormValidator
,XObjImageValidator
,XObjPostscriptValidator
This class processes commons validations of XObjects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PreflightContext
The validation context which contains useful information to process validation.protected COSDocument
The PDF document as COSDocument.protected COSStream
The XObject to validate as a COSStream. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
This method checks if required fields are present.protected void
checkOPI()
According the ISO 190005:1-2005 specification, a XObject can't have an OPI entry in its dictionary.protected void
According the ISO 190005:1-2005 specification, PostScript XObjects are forbidden.protected void
According the ISO 190005:1-2005 specification, a XObject can't have an Ref entry in its dictionary.protected void
This method checks the SMask entry in the XObject dictionary.void
validate()
Process the validation of the XObject.
-
Field Details
-
xobject
The XObject to validate as a COSStream. -
context
The validation context which contains useful information to process validation. -
cosDocument
The PDF document as COSDocument.
-
-
Constructor Details
-
AbstractXObjValidator
-
-
Method Details
-
checkSMask
protected void checkSMask()This method checks the SMask entry in the XObject dictionary. According to the PDF Reference, a SMask in a XObject is a Stream. So if it is not null, it should be an error but a SMask with the name None is authorized in the PDF/A Specification 6.4. If the validation fails (SMask not null and different from None), the error list is updated with the error code ERROR_GRAPHIC_TRANSPARENCY_SMASK (2.2.2). -
checkOPI
protected void checkOPI()According the ISO 190005:1-2005 specification, a XObject can't have an OPI entry in its dictionary. If the XObject has a OPI entry, the error list is updated with the error code ERROR_GRAPHIC_UNEXPECTED_KEY (2.3). -
checkReferenceXObject
protected void checkReferenceXObject()According the ISO 190005:1-2005 specification, a XObject can't have an Ref entry in its dictionary. If the XObject has a Ref entry, the error list is updated with the error code ERROR_GRAPHIC_UNEXPECTED_KEY (2.3). -
checkPostscriptXObject
protected void checkPostscriptXObject()According the ISO 190005:1-2005 specification, PostScript XObjects are forbidden. If the XObject is a PostScript XObject, the error list is updated with the error code ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY (2.3.2). To know whether the object is a Postscript XObject, "Subtype" and "Subtype2" entries are checked. -
checkMandatoryFields
protected abstract void checkMandatoryFields()This method checks if required fields are present. -
validate
Description copied from interface:XObjectValidator
Process the validation of the XObject.- Specified by:
validate
in interfaceXObjectValidator
- Throws:
ValidationException
-