|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.AcroFields
Query and change fields in existing documents either by method calls or by FDF merging.
Nested Class Summary | |
static class |
AcroFields.Item
The field representations for retrieval and modification. |
Field Summary | |
(package private) HashMap |
fields
|
private boolean |
generateAppearances
Holds value of property generateAppearances. |
(package private) PdfReader |
reader
|
private int |
topFirst
|
(package private) PdfWriter |
writer
|
Constructor Summary | |
(package private) |
AcroFields(PdfReader reader,
PdfWriter writer)
|
Method Summary | |
(package private) void |
fill()
|
(package private) PdfAppearance |
getAppearance(PdfDictionary merged,
String text)
|
String[] |
getAppearanceStates(String fieldName)
Gets the list of appearance names. |
String |
getField(String name)
Gets the field value. |
AcroFields.Item |
getFieldItem(String name)
Gets the field structure. |
float[] |
getFieldPositions(String name)
Gets the field box positions in the document. |
HashMap |
getFields()
Gets all the fields. |
(package private) Color |
getMKColor(PdfArray ar)
|
boolean |
isGenerateAppearances()
Gets the property generateAppearances. |
(package private) boolean |
isInAP(PdfDictionary dic,
PdfName check)
|
boolean |
removeField(String name)
Removes a field from the document. |
boolean |
removeField(String name,
int page)
Removes a field from the document. |
boolean |
removeFieldsFromPage(int page)
Removes all the fields from page . |
private int |
removeRefFromArray(PdfArray array,
PdfObject refo)
|
boolean |
renameField(String oldName,
String newName)
Renames a field. |
boolean |
setField(String name,
String value)
Sets the field value. |
boolean |
setField(String name,
String value,
String display)
Sets the field value and the display string. |
void |
setFields(FdfReader fdf)
Sets the fields by FDF merging. |
void |
setGenerateAppearances(boolean generateAppearances)
Sets the option to generate appearances. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
PdfReader reader
PdfWriter writer
HashMap fields
private int topFirst
private boolean generateAppearances
Constructor Detail |
AcroFields(PdfReader reader, PdfWriter writer)
Method Detail |
void fill()
public String[] getAppearanceStates(String fieldName)
fieldName
- the fully qualified field name
null
if the field does not existpublic boolean renameField(String oldName, String newName)
oldName
- the old field namenewName
- the new field name
true
if the renaming was successful, false
otherwisePdfAppearance getAppearance(PdfDictionary merged, String text) throws IOException, DocumentException
IOException
DocumentException
Color getMKColor(PdfArray ar)
public String getField(String name)
name
- the fully qualified field name
public void setFields(FdfReader fdf) throws IOException, DocumentException
fdf
- the FDF form
IOException
- on error
DocumentException
- on errorpublic boolean setField(String name, String value) throws IOException, DocumentException
name
- the fully qualified field namevalue
- the field value
true
if the field was found and changed,
false
otherwise
IOException
- on error
DocumentException
- on errorpublic boolean setField(String name, String value, String display) throws IOException, DocumentException
name
- the fully qualified field namevalue
- the field valuedisplay
- the string that is used for the appearance
true
if the field was found and changed,
false
otherwise
IOException
- on error
DocumentException
- on errorboolean isInAP(PdfDictionary dic, PdfName check)
public HashMap getFields()
AcroFields.Item
.
public AcroFields.Item getFieldItem(String name)
name
- the name of the field
null
if the field
does not existpublic float[] getFieldPositions(String name)
float
multiple of 5. For each of this groups the values are: [page, llx, lly, urx,
ury].
name
- the field name
null
if field does not existprivate int removeRefFromArray(PdfArray array, PdfObject refo)
public boolean removeFieldsFromPage(int page)
page
.
page
- the page to remove the fields from
true
if any field was removed, false otherwise
public boolean removeField(String name, int page)
name
are removed from the document otherwise only the fields in
that particular page are removed.
name
- the field namepage
- the page to remove the field from or -1 to remove it from all the pages
true
if the field exists, false otherwise
public boolean removeField(String name)
name
- the field name
true
if the field exists, false otherwise
public boolean isGenerateAppearances()
public void setGenerateAppearances(boolean generateAppearances)
true
.
generateAppearances
- the option to generate appearances
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |