Class PRAcroForm


  • public class PRAcroForm
    extends PdfDictionary
    This class captures an AcroForm on input. Basically, it extends Dictionary by indexing the fields of an AcroForm
    • Field Detail

      • fields

        private final java.util.ArrayList fields
      • stack

        private final java.util.ArrayList stack
      • fieldByName

        private final java.util.HashMap fieldByName
    • Constructor Detail

      • PRAcroForm

        PRAcroForm​(PdfReader reader)
        Constructor
        Parameters:
        reader - reader of the input file
    • Method Detail

      • size

        public int size()
        Number of fields found
        Overrides:
        size in class PdfDictionary
        Returns:
        size
      • getFields

        public java.util.ArrayList getFields()
      • readAcroForm

        void readAcroForm​(PdfDictionary root)
        Read, and comprehend the acroform
        Parameters:
        root - the document root
      • iterateFields

        private void iterateFields​(PdfArray fieldlist,
                                   PRIndirectReference fieldDict,
                                   java.lang.String title)
        After reading, we index all of the fields. Recursive.
        Parameters:
        fieldlist - An array of fields
        fieldDict - the last field dictionary we encountered (recursively)
        title - the pathname of the field, up to this point or null
      • mergeAttrib

        private PdfDictionary mergeAttrib​(PdfDictionary parent,
                                          PdfDictionary child)
        merge field attributes from two dictionaries
        Parameters:
        parent - one dictionary
        child - the other dictionary
        Returns:
        a merged dictionary
      • pushAttrib

        private void pushAttrib​(PdfDictionary dict)
        stack a level of dictionary. Merge in a dictionary from this level