Class PdfUA2FormChecker


  • public final class PdfUA2FormChecker
    extends java.lang.Object
    Class that provides methods for checking PDF/UA-2 compliance of interactive form fields.
    • Constructor Detail

    • 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 - the PdfDocument 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 and V values are textually equal.

        Parameters:
        form - the form PdfDictionary 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 for Form tag
      • checkWidgetKids

        private static void checkWidgetKids​(IStructureNode form)
        Checks that Form structure element contains at most one widget annotation.
        Parameters:
        form - Form structure element to check
        Throws:
        PdfUAConformanceException - if Form tag has incorrect kids
      • checkTextField

        private static void checkTextField​(PdfDictionary fieldDic)
      • checkWidget

        private void checkWidget​(PdfDictionary fieldDic)
      • isWidgetLabelPresent

        private boolean isWidgetLabelPresent​(IStructureNode widget)