Class AbstractXObjValidator

java.lang.Object
org.apache.pdfbox.preflight.xobject.AbstractXObjValidator
All Implemented Interfaces:
XObjectValidator
Direct Known Subclasses:
XObjFormValidator, XObjImageValidator, XObjPostscriptValidator

public abstract class AbstractXObjValidator extends Object implements XObjectValidator
This class processes commons validations of XObjects.
  • Field Details

    • xobject

      protected COSStream xobject
      The XObject to validate as a COSStream.
    • context

      protected PreflightContext context
      The validation context which contains useful information to process validation.
    • cosDocument

      protected COSDocument cosDocument
      The PDF document as COSDocument.
  • Constructor Details

  • 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

      public void validate() throws ValidationException
      Description copied from interface: XObjectValidator
      Process the validation of the XObject.
      Specified by:
      validate in interface XObjectValidator
      Throws:
      ValidationException