Class PdfUA2LinkChecker
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.utils.ua2.PdfUA2LinkChecker
-
public final class PdfUA2LinkChecker extends java.lang.ObjectClass that provides methods for checking PDF/UA-2 compliance of link annotations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPdfUA2LinkChecker.PdfUA2LinkAnnotationHandlerHelper class that checks the conformance of link annotations while iterating the tag tree structure.
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContextcontextprivate java.util.Map<PdfObject,java.util.Set<IStructureNode>>destinationToStructParentsMapprivate PdfDocumentpdfDoc
-
Constructor Summary
Constructors Modifier Constructor Description privatePdfUA2LinkChecker(PdfUAValidationContext context, PdfDocument pdfDoc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckLinkAnnotations(PdfDocument document)Verifies that each link annotation present in the document is tagged.private voidcheckLinkAnnotationStructureParent(IStructureNode elem)Checks that link annotation is enclosed in either a Link or Reference structure element.private voidcheckStructDestinationsInLinkAndReference(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 PdfArraygetDestination(PdfObject destination)private PdfArraygetDestination(PdfObject destination, java.util.Set<PdfObject> checkedDestinations)private PdfObjectgetStructureDestinationObject(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- thePdfDocumentto 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)
-
-