Class PdfUA2FormChecker
- java.lang.Object
-
- com.itextpdf.pdfua.checkers.utils.ua2.PdfUA2FormChecker
-
public final class PdfUA2FormChecker extends java.lang.Object
Class that provides methods for checking PDF/UA-2 compliance of interactive form fields.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PdfUA2FormChecker.PdfUA2FormTagHandler
Handler for checking form field elements in the tag tree.
-
Field Summary
Fields Modifier and Type Field Description private PdfUAValidationContext
context
-
Constructor Summary
Constructors Constructor Description PdfUA2FormChecker(PdfUAValidationContext validationContext)
Creates a newPdfUA2FormChecker
instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkFormFields(PdfDictionary form)
Verifies the conformity of the document Acroform dictionary.void
checkFormStructElement(IStructureNode elem)
Checks "Form" structure element.private static void
checkTextField(PdfDictionary fieldDic)
private void
checkWidget(PdfDictionary fieldDic)
void
checkWidgetAnnotations(PdfDocument document)
Verifies the conformity of the widget annotation present in the document.private static void
checkWidgetKids(IStructureNode form)
Checks thatForm
structure element contains at most one widget annotation.private static PdfObject
getValueFromParent(PdfDictionary field)
private static boolean
isWidget(IStructureNode node)
private boolean
isWidgetLabelPresent(IStructureNode widget)
-
-
-
Field Detail
-
context
private final PdfUAValidationContext context
-
-
Constructor Detail
-
PdfUA2FormChecker
public PdfUA2FormChecker(PdfUAValidationContext validationContext)
Creates a newPdfUA2FormChecker
instance.- Parameters:
validationContext
- the validation context
-
-
Method Detail
-
checkWidgetAnnotations
public void checkWidgetAnnotations(PdfDocument document)
Verifies the conformity of the widget annotation present in the document.Checks that each widget annotation is either Form structure element or an Artifact; if label for a widget annotation is not present or an additional action (AA) entry is present, Contents entry is provided.
- Parameters:
document
- thePdfDocument
to check widgets from
-
checkFormFields
public void checkFormFields(PdfDictionary form)
Verifies the conformity of the document Acroform dictionary.Checks that each widget annotation is either Form structure element or an Artifact; if label for a widget annotation is not present or an additional action (AA) entry is present, Contents entry is provided; text field
RV
andV
values are textually equal.- Parameters:
form
- the formPdfDictionary
to be checked
-
checkFormStructElement
public void checkFormStructElement(IStructureNode elem)
Checks "Form" structure element.- Parameters:
elem
- structure element to check- Throws:
PdfUAConformanceException
- if document has incorrect tag structure forForm
tag
-
checkWidgetKids
private static void checkWidgetKids(IStructureNode form)
Checks thatForm
structure element contains at most one widget annotation.- Parameters:
form
-Form
structure element to check- Throws:
PdfUAConformanceException
- ifForm
tag has incorrect kids
-
isWidget
private static boolean isWidget(IStructureNode node)
-
getValueFromParent
private static PdfObject getValueFromParent(PdfDictionary field)
-
checkTextField
private static void checkTextField(PdfDictionary fieldDic)
-
checkWidget
private void checkWidget(PdfDictionary fieldDic)
-
isWidgetLabelPresent
private boolean isWidgetLabelPresent(IStructureNode widget)
-
-