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 abstractPdfUAChecker
class.The specification implemented by this class is ISO 14289-1.
-
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContext
context
private PdfUA1HeadingsChecker
headingsChecker
private PdfDocument
pdfDocument
private TagStructureContext
tagStructureContext
-
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 void
checkCatalog(PdfCatalog catalog)
private void
checkCrypto(PdfDictionary encryptionDictionary)
protected void
checkFileSpec(PdfDictionary fileSpec)
Verify the conformity of the file specification dictionary.(package private) void
checkLogicalStructureInBMC(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 void
checkMetadata(PdfCatalog catalog)
Checks that theCatalog
dictionary of a conforming file (the version number of a file may be any value from 1.0 to 1.7) contains theMetadata
key whose value is a metadata stream.(package private) 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.(package private) void
checkOCProperties(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 void
checkPdfObject(PdfObject obj)
This method checks the requirements that must be fulfilled by a COS object in a PDF/UA document.private void
checkStandardRoleMapping(Tuple2<PdfName,PdfDictionary> tag)
private void
checkStructureTreeRoot(PdfStructTreeRoot structTreeRoot)
(package private) void
checkSymbolicCmapSubtable(TrueTypeFont fontProgram)
Checks cmap entries present in the embedded TrueType font program of the symbolic TrueType font.boolean
isPdfObjectReadyToFlush(PdfObject object)
IsPdfObject
ready to flush.void
validate(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
- theIValidationContext
to validate
-
isPdfObjectReadyToFlush
public boolean isPdfObjectReadyToFlush(PdfObject object)
IsPdfObject
ready to flush..- Parameters:
object
- the pdf object to check- Returns:
true
if the object is ready to flush,false
otherwise
-
checkFileSpec
protected void checkFileSpec(PdfDictionary fileSpec)
Verify the conformity of the file specification dictionary.- Parameters:
fileSpec
- thePdfDictionary
containing file specification to be checked
-
checkMetadata
protected void checkMetadata(PdfCatalog catalog)
Checks that theCatalog
dictionary of a conforming file (the version number of a file may be any value from 1.0 to 1.7) contains theMetadata
key whose value is a metadata stream. Also checks that the value ofpdfuaid:part
is 1 for conforming PDF files.Checks that the
Metadata
stream in the document catalog dictionary includes adc:title
entry reflecting the title of the document.- Parameters:
catalog
-PdfCatalog
document catalog dictionary
-
checkOCProperties
void checkOCProperties(PdfDictionary ocProperties)
Description copied from class:PdfUAChecker
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.Also checks that the AS key does not appear in any optional content configuration dictionary.
- Overrides:
checkOCProperties
in 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:PdfUAChecker
Checks if content marked as Artifact resides in Artifact content, but real content does not.- Overrides:
checkLogicalStructureInBMC
in classPdfUAChecker
- Parameters:
stack
- the tag structure stackcurrentBmc
- the current BMCdocument
-PdfDocument
to 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:
checkNonSymbolicCmapSubtable
in 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:
checkSymbolicCmapSubtable
in 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
-
-