Class PdfUAChecker

java.lang.Object
com.itextpdf.pdfua.checkers.PdfUAChecker
All Implemented Interfaces:
IValidationChecker
Direct Known Subclasses:
PdfUA1Checker, PdfUA2Checker

public abstract class PdfUAChecker extends Object implements IValidationChecker
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 Details

    • PdfUAChecker

      protected PdfUAChecker()
      Creates new PdfUAChecker instance.
  • Method Details

    • warnOnPageFlush

      public void warnOnPageFlush()
      Logs a warn on page flushing that page flushing is disabled in PDF/UA mode.
    • checkLang

      protected void checkLang (PdfCatalog catalog)
      Checks that the default natural language for content and text strings is specified using the Lang entry, with a nonempty value, in the document catalog dictionary.
      Parameters:
      catalog - PdfCatalog document catalog dictionary
    • checkViewerPreferences

      protected void checkViewerPreferences (PdfCatalog catalog)
      Checks that the ViewerPreferences dictionary of the document catalog dictionary is present and contains at least the DisplayDocTitle key with a value of true, as defined in ISO 32000-1:2008, 12.2, Table 150 or ISO 32000-2:2020, Table 147.
      Parameters:
      catalog - PdfCatalog document 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 - PdfDocument to 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 - PdfDocument to check
    • checkFonts

      protected void checkFonts (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.

      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

      protected void checkText (String str, PdfFont font)
      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