Package com.itextpdf.pdfua.checkers
Class PdfUAChecker
java.lang.Object
com.itextpdf.pdfua.checkers.PdfUAChecker
- All Implemented Interfaces:
-
IValidationChecker
- Direct Known Subclasses:
-
PdfUA1Checker,PdfUA2Checker
An abstract class that will run through all necessary checks defined in the different PDF/UA standards. A number of common checks are executed in this class, while standard-dependent specifications are implemented in the available subclasses. The standard that is followed is the series of ISO 14289 specifications, currently generations 1 and 2.
While it is possible to subclass this method and implement its abstract methods in client code, this is not encouraged and will have little effect. It is not possible to plug custom implementations into iText, because iText should always refuse to create non-compliant PDF/UA, which would be possible with client code implementations. Any future generations of the PDF/UA standard and its derivatives will get their own implementation in the iText - pdfua project.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckContentInCanvas(Stack<Tuple2<PdfName, PdfDictionary>> tagStack, PdfDocument document) Checks if content is neither marked as Artifact nor tagged as real content.protected voidcheckFonts(Collection<PdfFont> fontsInDocument) Checks that font programs for all fonts used for rendering within a conforming file, as determined by whether at least one of its glyphs is referenced from one or more content streams, are embedded within that file, as defined in ISO 32000-2:2020, 9.9 and ISO 32000-1:2008, 9.9.protected voidcheckLang(PdfCatalog catalog) Checks that the default natural language for content and text strings is specified using theLangentry, with a nonempty value, in the document catalog dictionary.protected voidcheckLogicalStructureInBMC(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 voidChecks that embedded fonts define all glyphs referenced for rendering within the conforming file.protected voidcheckViewerPreferences(PdfCatalog catalog) Checks that theViewerPreferencesdictionary of the document catalog dictionary is present and contains at least theDisplayDocTitlekey with a value oftrue, as defined in ISO 32000-1:2008, 12.2, Table 150 or ISO 32000-2:2020, Table 147.voidLogs a warn on page flushing that page flushing is disabled in PDF/UA mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.itextpdf.kernel.validation.IValidationChecker
isPdfObjectReadyToFlush, validate
-
Constructor Details
-
PdfUAChecker
protected PdfUAChecker()Creates newPdfUACheckerinstance.
-
-
Method Details
-
warnOnPageFlush
public void warnOnPageFlush()Logs a warn on page flushing that page flushing is disabled in PDF/UA mode. -
checkLang
Checks that the default natural language for content and text strings is specified using theLangentry, with a nonempty value, in the document catalog dictionary.- Parameters:
-
catalog-PdfCatalogdocument catalog dictionary
-
checkViewerPreferences
Checks that theViewerPreferencesdictionary of the document catalog dictionary is present and contains at least theDisplayDocTitlekey with a value oftrue, as defined in ISO 32000-1:2008, 12.2, Table 150 or ISO 32000-2:2020, Table 147.- Parameters:
-
catalog-PdfCatalogdocument catalog dictionary
-
checkLogicalStructureInBMC
protected void checkLogicalStructureInBMC(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.- Parameters:
-
stack- the tag structure stack -
currentBmc- the current BMC -
document-PdfDocumentto check
-
checkContentInCanvas
protected void checkContentInCanvas(Stack<Tuple2<PdfName, PdfDictionary>> tagStack, PdfDocument document) Checks if content is neither marked as Artifact nor tagged as real content.- Parameters:
-
tagStack- tag structure stack -
document-PdfDocumentto check
-
checkFonts
Checks that font programs for all fonts used for rendering within a conforming file, as determined by whether at least one of its glyphs is referenced from one or more content streams, are embedded within that file, as defined in ISO 32000-2:2020, 9.9 and ISO 32000-1:2008, 9.9.Checks character encodings rules as defined in ISO 14289-2, 8.4.5.7 and ISO 14289-1, 7.21.6.
- Parameters:
-
fontsInDocument- collection of fonts used in the document
-
checkText
Checks that embedded fonts define all glyphs referenced for rendering within the conforming file.- Parameters:
-
str- the text to check -
font- the font to check
-