Package com.lowagie.text.pdf
Class XfdfReader
java.lang.Object
com.lowagie.text.pdf.XfdfReader
- All Implemented Interfaces:
SimpleXMLDocHandler
Reads a XFDF.
- Author:
- Leonard Rosenthol (leonardr@pdfsages.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashMapStorage for field values if there's more than one value for a field. -
Constructor Summary
ConstructorsConstructorDescriptionXfdfReader(byte[] xfdfIn) Reads an XFDF form.XfdfReader(InputStream fin) XfdfReader(String filename) Reads an XFDF form. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after the document is parsed.voidendElement(String tag) Called when an end tag is found.Gets the field value.Gets all the fields.getFieldValue(String name) Gets the field value ornullif the field does not exist or has no value defined.Gets the PDF file specification contained in the FDF.getListValues(String name) Gets the field values for a list ornullif the field does not exist or has no value defined.voidCalled when the document starts to be parsed.voidstartElement(String tag, HashMap h) Called when a start tag is found.voidCalled when a text element is found.
-
Field Details
-
listFields
Storage for field values if there's more than one value for a field.- Since:
- 2.1.4
-
-
Constructor Details
-
XfdfReader
Reads an XFDF form.- Parameters:
filename- the file name of the form- Throws:
IOException- on error
-
XfdfReader
- Throws:
IOException
-
XfdfReader
Reads an XFDF form.- Parameters:
xfdfIn- the byte array with the form- Throws:
IOException- on error
-
-
Method Details
-
getFields
Gets all the fields. The map is keyed by the fully qualified field name and the value is a mergedPdfDictionarywith the field content.- Returns:
- all the fields
-
getField
Gets the field value.- Parameters:
name- the fully qualified field name- Returns:
- the field's value
-
getFieldValue
Gets the field value ornullif the field does not exist or has no value defined.- Parameters:
name- the fully qualified field name- Returns:
- the field value or
null
-
getListValues
Gets the field values for a list ornullif the field does not exist or has no value defined.- Parameters:
name- the fully qualified field name- Returns:
- the field values or
null - Since:
- 2.1.4
-
getFileSpec
Gets the PDF file specification contained in the FDF.- Returns:
- the PDF file specification contained in the FDF
-
startElement
Called when a start tag is found.- Specified by:
startElementin interfaceSimpleXMLDocHandler- Parameters:
tag- the tag nameh- the tag's attributes
-
endElement
Called when an end tag is found.- Specified by:
endElementin interfaceSimpleXMLDocHandler- Parameters:
tag- the tag name
-
startDocument
public void startDocument()Called when the document starts to be parsed.- Specified by:
startDocumentin interfaceSimpleXMLDocHandler
-
endDocument
public void endDocument()Called after the document is parsed.- Specified by:
endDocumentin interfaceSimpleXMLDocHandler
-
text
Called when a text element is found.- Specified by:
textin interfaceSimpleXMLDocHandler- Parameters:
str- the text element, probably a fragment.
-