Package com.lowagie.text.pdf
Class XfdfReader
java.lang.Object
com.lowagie.text.pdf.XfdfReader
- All Implemented Interfaces:
FieldReader
,SimpleXMLDocHandler
Reads a XFDF.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXfdfReader
(byte[] xfdfIn) Reads an XFDF form.XfdfReader
(String filename) Reads an XFDF form. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called after the document is parsed.void
endElement
(String tag) Called when an end tag is found.Gets the field value.getFieldValue
(String name) Gets the field value ornull
if 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 ornull
if the field does not exist or has no value defined.void
Called when the document starts to be parsed.void
startElement
(String tag, Map<String, String> h) Called when a start tag is found.void
Called when a text element is found.
-
Field Details
-
foundRoot
private boolean foundRoot -
fieldNames
-
fieldValues
-
fields
-
listFields
Storage for field values if there's more than one value for a field.- Since:
- 2.1.4
-
fileSpec
-
-
Constructor Details
-
XfdfReader
Reads an XFDF form.- Parameters:
filename
- the file name of the form- Throws:
IOException
- on error
-
XfdfReader
Reads an XFDF form.- Parameters:
xfdfIn
- the byte array with the form- Throws:
IOException
- on error
-
-
Method Details
-
getAllFields
- Specified by:
getAllFields
in interfaceFieldReader
-
getField
Gets the field value.- Parameters:
name
- the fully qualified field name- Returns:
- the field's value
-
getFieldValue
Gets the field value ornull
if the field does not exist or has no value defined.- Specified by:
getFieldValue
in interfaceFieldReader
- Parameters:
name
- the fully qualified field name- Returns:
- the field value or
null
-
getListValues
Gets the field values for a list ornull
if the field does not exist or has no value defined.- Specified by:
getListValues
in interfaceFieldReader
- 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:
startElement
in interfaceSimpleXMLDocHandler
- Parameters:
tag
- the tag nameh
- the tag's attributes
-
endElement
Called when an end tag is found.- Specified by:
endElement
in interfaceSimpleXMLDocHandler
- Parameters:
tag
- the tag name
-
startDocument
public void startDocument()Called when the document starts to be parsed.- Specified by:
startDocument
in interfaceSimpleXMLDocHandler
-
endDocument
public void endDocument()Called after the document is parsed.- Specified by:
endDocument
in interfaceSimpleXMLDocHandler
-
text
Called when a text element is found.- Specified by:
text
in interfaceSimpleXMLDocHandler
- Parameters:
str
- the text element, probably a fragment.
-