Class PdfUA2LinkChecker
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.utils.ua2.PdfUA2LinkChecker
-
public final class PdfUA2LinkChecker extends java.lang.Object
Class that provides methods for checking PDF/UA-2 compliance of link annotations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdfUA2LinkChecker.PdfUA2LinkAnnotationHandler
Helper class that checks the conformance of link annotations while iterating the tag tree structure.
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContext
context
private java.util.Map<PdfObject,java.util.Set<IStructureNode>>
destinationToStructParentsMap
private PdfDocument
pdfDoc
-
Constructor Summary
Constructors Modifier Constructor Description private
PdfUA2LinkChecker(PdfUAValidationContext context, PdfDocument pdfDoc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
checkLinkAnnotations(PdfDocument document)
Verifies that each link annotation present in the document is tagged.private void
checkLinkAnnotationStructureParent(IStructureNode elem)
Checks that link annotation is enclosed in either a Link or Reference structure element.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.private PdfArray
getDestination(PdfObject destination)
private PdfArray
getDestination(PdfObject destination, java.util.Set<PdfObject> checkedDestinations)
private PdfObject
getStructureDestinationObject(PdfDictionary annotObj)
-
-
-
Field Detail
-
pdfDoc
private final PdfDocument pdfDoc
-
context
private final PdfUAValidationContext context
-
destinationToStructParentsMap
private final java.util.Map<PdfObject,java.util.Set<IStructureNode>> destinationToStructParentsMap
-
-
Constructor Detail
-
PdfUA2LinkChecker
private PdfUA2LinkChecker(PdfUAValidationContext context, PdfDocument pdfDoc)
-
-
Method Detail
-
checkLinkAnnotations
public static void checkLinkAnnotations(PdfDocument document)
Verifies that each link annotation present in the document is tagged.- Parameters:
document
- thePdfDocument
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)
-
-