Class Pdf20Checker

  • All Implemented Interfaces:
    IValidationChecker

    public class Pdf20Checker
    extends java.lang.Object
    implements IValidationChecker
    Class that will run through all necessary checks defined in the PDF 2.0 standard. The standard that is followed is the series of ISO 32000 specifications, starting from ISO 32000-2:2020.
    • Field Detail

      • EXCEPTION_SUPPLIER

        private static final java.util.function.Function<java.lang.String,​PdfException> EXCEPTION_SUPPLIER
    • Constructor Detail

      • Pdf20Checker

        public Pdf20Checker​(PdfDocument pdfDocument)
        Creates new Pdf20Checker instance to validate PDF document against PDF 2.0 standard.
        Parameters:
        pdfDocument - PdfDocument to check
    • Method Detail

      • checkLang

        void checkLang​(PdfCatalog catalog)
        Checks that natural language is declared using the methods described in ISO 32000-2:2020, 14.9.2.
        Parameters:
        catalog - PdfCatalog document catalog dictionary
      • checkMetadata

        void checkMetadata​(PdfCatalog catalog)
        Checks that the value of the Metadata key from the Catalog dictionary of a conforming file is a metadata stream as defined in ISO 32000-2:2020.
        Parameters:
        catalog - PdfCatalog document catalog dictionary
      • checkStructureTreeRoot

        void checkStructureTreeRoot​(PdfStructTreeRoot structTreeRoot)
        Validates document structure tree root dictionary against PDF 2.0 standard.

        Checks, that all structure elements are belong to, or role mapped to (such role mapping may be transitive through other namespaces), at least one of the following namespaces specified in ISO 32000-2:2020, 14.8.6: — the PDF 1.7 namespace; — the PDF 2.0 namespace; — the MathML namespace. A structure element with no explicit namespace may be present. Such a structure element shall have, after any role mapping, a structure type matching one of the unique PDF 1.7 element types (the default standard structure namespace in ISO 32000-2 is defined as the PDF 1.7 namespace).

        Parameters:
        structTreeRoot - PdfStructTreeRoot to validate
      • checkCatalog

        private void checkCatalog​(PdfCatalog catalog)
        Validates document catalog dictionary against PDF 2.0 standard.

        For now, only Metadata and Lang are checked.

        Parameters:
        catalog - PdfCatalog document catalog dictionary to check