Class PdfUA2FormChecker
java.lang.Object
com.itextpdf.pdfua.checkers.utils.ua2.PdfUA2FormChecker
Class that provides methods for checking PDF/UA-2 compliance of interactive form fields.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHandler for checking form field elements in the tag tree. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPdfUA2FormChecker(PdfUAValidationContext validationContext) Creates a newPdfUA2FormCheckerinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckFormFields(PdfDictionary form) Verifies the conformity of the document Acroform dictionary.voidChecks "Form" structure element.private static voidcheckTextField(PdfDictionary fieldDic) private voidcheckWidget(PdfDictionary fieldDic) voidcheckWidgetAnnotations(PdfDocument document) Verifies the conformity of the widget annotation present in the document.private static voidChecks thatFormstructure element contains at most one widget annotation.private static PdfObjectgetValueFromParent(PdfDictionary field) private static booleanisWidget(IStructureNode node) private booleanisWidgetLabelPresent(IStructureNode widget)
-
Field Details
-
context
-
-
Constructor Details
-
PdfUA2FormChecker
Creates a newPdfUA2FormCheckerinstance.- Parameters:
validationContext- the validation context
-
-
Method Details
-
checkWidgetAnnotations
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- thePdfDocumentto check widgets from
-
checkFormFields
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
RVandVvalues are textually equal.- Parameters:
form- the formPdfDictionaryto be checked
-
checkFormStructElement
Checks "Form" structure element.- Parameters:
elem- structure element to check- Throws:
PdfUAConformanceException- if document has incorrect tag structure forFormtag
-
checkWidgetKids
Checks thatFormstructure element contains at most one widget annotation.- Parameters:
form-Formstructure element to check- Throws:
PdfUAConformanceException- ifFormtag has incorrect kids
-
isWidget
-
getValueFromParent
-
checkTextField
-
checkWidget
-
isWidgetLabelPresent
-