com.lowagie.text.pdf

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

Author: Mark Thompson

Nested Class Summary
static classPRAcroForm.FieldInformation
This class holds the information for a single field
Field Summary
HashMapfieldByName
ArrayListfields
PdfReaderreader
ArrayListstack
Constructor Summary
PRAcroForm(PdfReader reader)
Constructor
Method Summary
PRAcroForm.FieldInformationgetField(String name)
ArrayListgetFields()
PRIndirectReferencegetRefByName(String name)
Given the title (/T) of a reference, return the associated reference
protected voiditerateFields(PdfArray fieldlist, PRIndirectReference fieldDict, String title)
After reading, we index all of the fields.
protected PdfDictionarymergeAttrib(PdfDictionary parent, PdfDictionary child)
merge field attributes from two dictionaries
protected voidpushAttrib(PdfDictionary dict)
stack a level of dictionary.
voidreadAcroForm(PdfDictionary root)
Read, and comprehend the acroform
intsize()
Number of fields found

Field Detail

fieldByName

HashMap fieldByName

fields

ArrayList fields

reader

PdfReader reader

stack

ArrayList stack

Constructor Detail

PRAcroForm

public PRAcroForm(PdfReader reader)
Constructor

Parameters: reader reader of the input file

Method Detail

getField

public PRAcroForm.FieldInformation getField(String name)

getFields

public ArrayList getFields()

getRefByName

public PRIndirectReference getRefByName(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

iterateFields

protected void iterateFields(PdfArray fieldlist, PRIndirectReference fieldDict, 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

protected 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

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

readAcroForm

public void readAcroForm(PdfDictionary root)
Read, and comprehend the acroform

Parameters: root the docment root

size

public int size()
Number of fields found

Returns: size