Package com.itextpdf.pdfua.checkers
Class PdfUA1Checker
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.PdfUAChecker
-
- com.itextpdf.pdfua.checkers.PdfUA1Checker
-
- All Implemented Interfaces:
IValidationChecker
public class PdfUA1Checker extends PdfUAChecker
The class defines the requirements of the PDF/UA-1 standard and contains method implementations from the abstractPdfUACheckerclass.The specification implemented by this class is ISO 14289-1.
-
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContextcontextprivate PdfUA1HeadingsCheckerheadingsCheckerprivate PdfDocumentpdfDocumentprivate TagStructureContexttagStructureContext-
Fields inherited from class com.itextpdf.pdfua.checkers.PdfUAChecker
EXCEPTION_SUPPLIER
-
-
Constructor Summary
Constructors Constructor Description PdfUA1Checker(PdfDocument pdfDocument)Creates PdfUA1Checker instance with PDF document which will be validated against PDF/UA-1 standard.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckCatalog(PdfCatalog catalog)private voidcheckCrypto(PdfDictionary encryptionDictionary)protected voidcheckFileSpec(PdfDictionary fileSpec)Verify the conformity of the file specification dictionary.(package private) voidcheckLogicalStructureInBMC(java.util.Stack<Tuple2<PdfName,PdfDictionary>> stack, Tuple2<PdfName,PdfDictionary> currentBmc, PdfDocument document)Checks if content marked as Artifact resides in Artifact content, but real content does not.protected voidcheckMetadata(PdfCatalog catalog)Checks that theCatalogdictionary of a conforming file (the version number of a file may be any value from 1.0 to 1.7) contains theMetadatakey whose value is a metadata stream.(package private) voidcheckNonSymbolicCmapSubtable(TrueTypeFont fontProgram)For all non-symbolic TrueType fonts used for rendering, the embedded TrueType font program shall contain one or several non-symbolic cmap entries such that all necessary glyph lookups can be carried out.(package private) voidcheckOCProperties(PdfDictionary ocProperties)Checks that all optional content configuration dictionaries in the file, including the default one, shall contain a Name entry (see ISO 32000-2:2020, Table 96, or ISO 32000-1:2008, 8.11.2.1, Table 98) whose value is a non-empty text string when document contains a Configs entry in the OCProperties entry of the document catalog dictionary (see ISO 32000-2:2020, Table 29, or ISO 32000-1:2008, 7.7.2, Table 28), and the Configs entry contains at least one optional content configuration dictionary.private voidcheckPdfObject(PdfObject obj)This method checks the requirements that must be fulfilled by a COS object in a PDF/UA document.private voidcheckStandardRoleMapping(Tuple2<PdfName,PdfDictionary> tag)private voidcheckStructureTreeRoot(PdfStructTreeRoot structTreeRoot)(package private) voidcheckSymbolicCmapSubtable(TrueTypeFont fontProgram)Checks cmap entries present in the embedded TrueType font program of the symbolic TrueType font.booleanisPdfObjectReadyToFlush(PdfObject object)IsPdfObjectready to flush.voidvalidate(IValidationContext context)Validate the providedIValidationContext.-
Methods inherited from class com.itextpdf.pdfua.checkers.PdfUAChecker
checkContentInCanvas, checkFonts, checkLang, checkText, checkViewerPreferences, warnOnPageFlush
-
-
-
-
Field Detail
-
pdfDocument
private final PdfDocument pdfDocument
-
tagStructureContext
private final TagStructureContext tagStructureContext
-
headingsChecker
private final PdfUA1HeadingsChecker headingsChecker
-
context
private final PdfUAValidationContext context
-
-
Constructor Detail
-
PdfUA1Checker
public PdfUA1Checker(PdfDocument pdfDocument)
Creates PdfUA1Checker instance with PDF document which will be validated against PDF/UA-1 standard.- Parameters:
pdfDocument- the document to validate
-
-
Method Detail
-
validate
public void validate(IValidationContext context)
Validate the providedIValidationContext..- Parameters:
context- theIValidationContextto validate
-
isPdfObjectReadyToFlush
public boolean isPdfObjectReadyToFlush(PdfObject object)
IsPdfObjectready to flush..- Parameters:
object- the pdf object to check- Returns:
trueif the object is ready to flush,falseotherwise
-
checkFileSpec
protected void checkFileSpec(PdfDictionary fileSpec)
Verify the conformity of the file specification dictionary.- Parameters:
fileSpec- thePdfDictionarycontaining file specification to be checked
-
checkMetadata
protected void checkMetadata(PdfCatalog catalog)
Checks that theCatalogdictionary of a conforming file (the version number of a file may be any value from 1.0 to 1.7) contains theMetadatakey whose value is a metadata stream. Also checks that the value ofpdfuaid:partis 1 for conforming PDF files.Checks that the
Metadatastream in the document catalog dictionary includes adc:titleentry reflecting the title of the document.- Parameters:
catalog-PdfCatalogdocument catalog dictionary
-
checkOCProperties
void checkOCProperties(PdfDictionary ocProperties)
Description copied from class:PdfUACheckerChecks that all optional content configuration dictionaries in the file, including the default one, shall contain a Name entry (see ISO 32000-2:2020, Table 96, or ISO 32000-1:2008, 8.11.2.1, Table 98) whose value is a non-empty text string when document contains a Configs entry in the OCProperties entry of the document catalog dictionary (see ISO 32000-2:2020, Table 29, or ISO 32000-1:2008, 7.7.2, Table 28), and the Configs entry contains at least one optional content configuration dictionary.Also checks that the AS key does not appear in any optional content configuration dictionary.
- Overrides:
checkOCPropertiesin classPdfUAChecker- Parameters:
ocProperties- OCProperties entry of the Catalog dictionary
-
checkLogicalStructureInBMC
void checkLogicalStructureInBMC(java.util.Stack<Tuple2<PdfName,PdfDictionary>> stack, Tuple2<PdfName,PdfDictionary> currentBmc, PdfDocument document)
Description copied from class:PdfUACheckerChecks if content marked as Artifact resides in Artifact content, but real content does not.- Overrides:
checkLogicalStructureInBMCin classPdfUAChecker- Parameters:
stack- the tag structure stackcurrentBmc- the current BMCdocument-PdfDocumentto check
-
checkNonSymbolicCmapSubtable
void checkNonSymbolicCmapSubtable(TrueTypeFont fontProgram)
For all non-symbolic TrueType fonts used for rendering, the embedded TrueType font program shall contain one or several non-symbolic cmap entries such that all necessary glyph lookups can be carried out.- Specified by:
checkNonSymbolicCmapSubtablein classPdfUAChecker- Parameters:
fontProgram- the embedded TrueType font program to check
-
checkSymbolicCmapSubtable
void checkSymbolicCmapSubtable(TrueTypeFont fontProgram)
Checks cmap entries present in the embedded TrueType font program of the symbolic TrueType font.The “cmap” table in the embedded font program shall either contain exactly one encoding or it shall contain, at least, the Microsoft Symbol (3,0 – Platform ID = 3, Encoding ID = 0) encoding.
- Specified by:
checkSymbolicCmapSubtablein classPdfUAChecker- Parameters:
fontProgram- the embedded TrueType font program to check
-
checkStandardRoleMapping
private void checkStandardRoleMapping(Tuple2<PdfName,PdfDictionary> tag)
-
checkCatalog
private void checkCatalog(PdfCatalog catalog)
-
checkStructureTreeRoot
private void checkStructureTreeRoot(PdfStructTreeRoot structTreeRoot)
-
checkCrypto
private void checkCrypto(PdfDictionary encryptionDictionary)
-
checkPdfObject
private void checkPdfObject(PdfObject obj)
This method checks the requirements that must be fulfilled by a COS object in a PDF/UA document.- Parameters:
obj- the COS object that must be checked
-
-