Class PdfUA2LinkChecker

java.lang.Object
com.itextpdf.pdfua.checkers.utils.ua2.PdfUA2LinkChecker

public final class PdfUA2LinkChecker extends Object
Class that provides methods for checking PDF/UA-2 compliance of link annotations.
  • Field Details

  • Constructor Details

  • Method Details

    • checkLinkAnnotations

      public static void checkLinkAnnotations(PdfDocument document)
      Verifies that each link annotation present in the document is tagged.
      Parameters:
      document - the PdfDocument to check links for
    • checkLinkAnnotationStructureParent

      private void checkLinkAnnotationStructureParent(IStructureNode elem)
      Checks that link annotation is enclosed in either a Link or Reference structure element.

      Also checks that link annotations that target different locations are in separate Link or Reference structure elements, and multiple link annotations targeting the same location are included in a single Link or Reference structure element.

      Parameters:
      elem - link annotation object reference in the structure tree
    • checkStructDestinationsInLinkAndReference

      private void checkStructDestinationsInLinkAndReference(PdfObjRef objRef)
      Checks that link annotations that target different locations (destinations) are in separate Link or Reference structure elements, and multiple link annotations targeting the same location are included in a single Link or Reference structure element.
      Parameters:
      objRef - link annotation object reference in the structure tree
    • getStructureDestinationObject

      private PdfObject getStructureDestinationObject(PdfDictionary annotObj)
    • getDestination

      private PdfArray getDestination(PdfObject destination)
    • getDestination

      private PdfArray getDestination(PdfObject destination, Set<PdfObject> checkedDestinations)