Package com.itextpdf.text.pdf
Class PRAcroForm
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfDictionary
-
- com.itextpdf.text.pdf.PRAcroForm
-
- All Implemented Interfaces:
java.io.Serializable
public class PRAcroForm extends PdfDictionary
This class captures an AcroForm on input. Basically, it extends Dictionary by indexing the fields of an AcroForm- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PRAcroForm.FieldInformation
This class holds the information for a single field
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.HashMap<java.lang.String,PRAcroForm.FieldInformation>
fieldByName
(package private) java.util.ArrayList<PRAcroForm.FieldInformation>
fields
(package private) PdfReader
reader
(package private) java.util.ArrayList<PdfDictionary>
stack
-
Constructor Summary
Constructors Constructor Description PRAcroForm(PdfReader reader)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PRAcroForm.FieldInformation
getField(java.lang.String name)
java.util.ArrayList<PRAcroForm.FieldInformation>
getFields()
PRIndirectReference
getRefByName(java.lang.String name)
Given the title (/T) of a reference, return the associated referenceprotected void
iterateFields(PdfArray fieldlist, PRIndirectReference fieldDict, java.lang.String parentPath)
After reading, we index all of the fields.protected PdfDictionary
mergeAttrib(PdfDictionary parent, PdfDictionary child)
merge field attributes from two dictionariesprotected void
pushAttrib(PdfDictionary dict)
stack a level of dictionary.void
readAcroForm(PdfDictionary root)
Read, and comprehend the acroformint
size()
Number of fields found-
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, toPdf, toString
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Field Detail
-
fields
java.util.ArrayList<PRAcroForm.FieldInformation> fields
-
stack
java.util.ArrayList<PdfDictionary> stack
-
fieldByName
java.util.HashMap<java.lang.String,PRAcroForm.FieldInformation> fieldByName
-
reader
PdfReader reader
-
-
Constructor Detail
-
PRAcroForm
public PRAcroForm(PdfReader reader)
Constructor- Parameters:
reader
- reader of the input file
-
-
Method Detail
-
size
public int size()
Number of fields found- Overrides:
size
in classPdfDictionary
- Returns:
- size
-
getFields
public java.util.ArrayList<PRAcroForm.FieldInformation> getFields()
-
getField
public PRAcroForm.FieldInformation getField(java.lang.String name)
-
getRefByName
public PRIndirectReference getRefByName(java.lang.String name)
Given the title (/T) of a reference, return the associated reference- Parameters:
name
- a string containing the path- Returns:
- a reference to the field, or null
-
readAcroForm
public void readAcroForm(PdfDictionary root)
Read, and comprehend the acroform- Parameters:
root
- the document root
-
iterateFields
protected void iterateFields(PdfArray fieldlist, PRIndirectReference fieldDict, java.lang.String parentPath)
After reading, we index all of the fields. Recursive.- Parameters:
fieldlist
- An array of fieldsfieldDict
- the last field dictionary we encountered (recursively)parentPath
- the pathname of the field, up to this point or null
-
mergeAttrib
protected PdfDictionary mergeAttrib(PdfDictionary parent, PdfDictionary child)
merge field attributes from two dictionaries- Parameters:
parent
- one dictionarychild
- the other dictionary- Returns:
- a merged dictionary
-
pushAttrib
protected void pushAttrib(PdfDictionary dict)
stack a level of dictionary. Merge in a dictionary from this level
-
-