Class Pdf20Checker
java.lang.Object
com.itextpdf.kernel.validation.Pdf20Checker
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classprivate static classHandler class that checks structure nodes while traversing the document structure tree. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PdfAllowedTagRelationsprivate static final Function<String, PdfException> private final TagStructureContext -
Constructor Summary
ConstructorsConstructorDescriptionPdf20Checker(PdfDocument pdfDocument) Creates newPdf20Checkerinstance to validate PDF document against PDF 2.0 standard. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckCatalog(PdfCatalog catalog) Validates document catalog dictionary against PDF 2.0 standard.(package private) voidcheckLang(PdfCatalog catalog) Checks that natural language is declared using the methods described in ISO 32000-2:2020, 14.9.2.(package private) voidcheckMetadata(PdfCatalog catalog) Checks that the value of theMetadatakey from theCatalogdictionary of a conforming file is a metadata stream as defined in ISO 32000-2:2020.(package private) voidcheckStructureTreeRoot(PdfStructTreeRoot structTreeRoot) Validates document structure tree root dictionary against PDF 2.0 standard.booleanisPdfObjectReadyToFlush(PdfObject object) IsPdfObjectready to flush.voidvalidate(IValidationContext validationContext) Validate the providedIValidationContext.
-
Field Details
-
EXCEPTION_SUPPLIER
-
allowedTagRelations
-
tagStructureContext
-
-
Constructor Details
-
Pdf20Checker
Creates newPdf20Checkerinstance to validate PDF document against PDF 2.0 standard.- Parameters:
pdfDocument-PdfDocumentto check
-
-
Method Details
-
validate
Description copied from interface:IValidationCheckerValidate the providedIValidationContext.- Specified by:
validatein interfaceIValidationChecker- Parameters:
validationContext- theIValidationContextto validate
-
isPdfObjectReadyToFlush
Description copied from interface:IValidationCheckerIsPdfObjectready to flush.- Specified by:
isPdfObjectReadyToFlushin interfaceIValidationChecker- Parameters:
object- the pdf object to check- Returns:
trueif the object is ready to flush,falseotherwise
-
checkLang
Checks that natural language is declared using the methods described in ISO 32000-2:2020, 14.9.2.- Parameters:
catalog-PdfCatalogdocument catalog dictionary
-
checkMetadata
Checks that the value of theMetadatakey from theCatalogdictionary of a conforming file is a metadata stream as defined in ISO 32000-2:2020.- Parameters:
catalog-PdfCatalogdocument catalog dictionary
-
checkStructureTreeRoot
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-PdfStructTreeRootto validate
-
checkCatalog
Validates document catalog dictionary against PDF 2.0 standard.For now, only
MetadataandLangare checked.- Parameters:
catalog-PdfCatalogdocument catalog dictionary to check
-