Package com.itextpdf.pdfua.checkers
Class PdfUA2Checker
java.lang.Object
com.itextpdf.pdfua.checkers.PdfUAChecker
com.itextpdf.pdfua.checkers.PdfUA2Checker
- All Implemented Interfaces:
-
IValidationChecker
- Direct Known Subclasses:
-
WellTaggedPdfForAccessibilityChecker
The class defines the requirements of the PDF/UA-2 standard and contains method implementations from the abstract
PdfUAChecker class.
The specification implemented by this class is ISO 14289-2.
-
Constructor Summary
ConstructorsConstructorDescriptionPdfUA2Checker(PdfDocument pdfDocument) CreatesPdfUA2Checkerinstance with PDF document which will be validated against PDF/UA-2 standard. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckCatalog(PdfCatalog catalog) Validates document catalog dictionary against PDF/UA-2 standard.protected voidcheckFormFieldsAndAnnotations(PdfCatalog catalog) Validates all annotations and form fields present in the document against PDF/UA-2 standard.protected voidcheckMetadata(PdfCatalog catalog) Checks that theCatalogdictionary of a conforming file contains theMetadatakey whose value is a metadata stream as defined in ISO 32000-2:2020.protected voidcheckPdfObject(PdfObject obj) Checks that the given PDF object and all its descendant objects recursively (if any) are compliant with PDF/UA-2 standard.protected voidcheckStructureTreeRoot(PdfStructTreeRoot structTreeRoot) Validates structure tree root dictionary against PDF/UA-2 standard.protected TagTreeIteratorcreateTagTreeIterator(PdfStructTreeRoot structTreeRoot) CreatesTagTreeIteratorresponsible for validation of tag tree elements.protected PdfDocumentGets the PDF document being validated.protected PdfUAValidationContextGets the PDF/UA validation context which contains common information and utilities used for PDF/UA validation.booleanisPdfObjectReadyToFlush(PdfObject object) IsPdfObjectready to flush.voidvalidate(IValidationContext context) Validate the providedIValidationContext.Methods inherited from class com.itextpdf.pdfua.checkers.PdfUAChecker
checkContentInCanvas, checkFonts, checkLang, checkLogicalStructureInBMC, checkText, checkViewerPreferences, warnOnPageFlush
-
Constructor Details
-
PdfUA2Checker
CreatesPdfUA2Checkerinstance with PDF document which will be validated against PDF/UA-2 standard.- Parameters:
-
pdfDocument- the document to validate
-
-
Method Details
-
validate
Description copied from interface:IValidationCheckerValidate the providedIValidationContext.- Parameters:
-
context- theIValidationContextto validate
-
isPdfObjectReadyToFlush
Description copied from interface:IValidationCheckerIsPdfObjectready to flush.- Parameters:
-
object- the pdf object to check - Returns:
-
trueif the object is ready to flush,falseotherwise
-
getUAValidationContext
Gets the PDF/UA validation context which contains common information and utilities used for PDF/UA validation.- Returns:
- the PDF/UA validation context
-
getPdfDocument
Gets the PDF document being validated.- Returns:
- the PDF document being validated
-
checkMetadata
Checks that theCatalogdictionary of a conforming file contains theMetadatakey whose value is a metadata stream as defined in ISO 32000-2:2020. Also checks that the value ofpdfuaid:partis 2 for conforming PDF files and validates requiredpdfuaid:revvalue.Checks that the
Metadatastream as specified in ISO 32000-2:2020, 14.3 in the document catalog dictionary includes adc: titleentry reflecting the title of the document.- Parameters:
-
catalog-PdfCatalogdocument catalog dictionary
-
checkPdfObject
Checks that the given PDF object and all its descendant objects recursively (if any) are compliant with PDF/UA-2 standard. The check is performed on all objects except for indirect objects.- Parameters:
-
obj- the PDF object to check
-
checkCatalog
Validates document catalog dictionary against PDF/UA-2 standard.- Parameters:
-
catalog-PdfCatalogdocument catalog dictionary to check
-
checkFormFieldsAndAnnotations
Validates all annotations and form fields present in the document against PDF/UA-2 standard.- Parameters:
-
catalog-PdfCatalogto check form fields present in the acroform
-
checkStructureTreeRoot
Validates structure tree root dictionary against PDF/UA-2 standard.Additionally, checks that within a given explicitly provided namespace, structure types are not role mapped to other structure types in the same namespace. In the StructTreeRoot RoleMap there is no explicitly provided namespace, that's why it is not checked.
- Parameters:
-
structTreeRoot-PdfStructTreeRootstructure tree root dictionary to check
-
createTagTreeIterator
CreatesTagTreeIteratorresponsible for validation of tag tree elements.- Parameters:
-
structTreeRoot-PdfStructTreeRootto be validated - Returns:
-
TagTreeIteratorresponsible for validation of tag tree elements
-