java.lang.Object | |
↳ | com.pdftron.fdf.FDFDoc |
FDFDoc is a class representing Forms Data Format (FDF) documents. FDF is typically used when submitting form data to a server, receiving the response, and incorporating it into the interactive form. It can also be used to export form data to stand-alone files that can be stored, transmitted electronically, and imported back into the corresponding PDF interactive form. In addition, beginning in PDF 1.3, FDF can be used to define a container for annotations that are separate from the PDF document to which they apply. Note: While the constructor does not, a few methods in FDFDoc will cause it to count as a document for the consumption-based licensing if was not created through PDFDoc::FDFExtract(). Please consult individual API documentation for exact details.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FDFDoc()
Default constructor.
| |||||||||||
FDFDoc(SDFDoc sdfdoc)
Create a FDF document from an existing SDF/Cos document.
| |||||||||||
FDFDoc(String filepath)
Open an existing FDF document.
| |||||||||||
FDFDoc(Filter stream)
Open an existing FDF document.
| |||||||||||
FDFDoc(byte[] buf)
Open a SDF/Cos document from a memory buffer.
| |||||||||||
FDFDoc(InputStream stream)
Open an existing FDF document from an InputStream.
| |||||||||||
FDFDoc(InputStream stream, int size)
Open an existing FDF document from an InputStream.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static FDFDoc | __Create(long impl) | ||||||||||
long | __GetHandle() | ||||||||||
void |
close()
Close FDFDoc
| ||||||||||
static FDFDoc |
createFromXFDF(String xfdf)
Create a new FDFDoc from XFDF input.
| ||||||||||
FDFField |
fieldCreate(String field_name, int field_type)
Create a new interactive form FDFField.
| ||||||||||
FDFField |
fieldCreate(String field_name, int field_type, String field_value)
Create a FDFField with specified name, type and string value
| ||||||||||
FDFField |
fieldCreate(String field_name, int field_type, Obj field_value)
Create a FDFField with specified name, type and value
| ||||||||||
Obj |
getFDF()
Get the FDF dictionary.
| ||||||||||
FDFField |
getField(String field_name)
field_name a string representing the fully qualified name of
the field (e.g.
| ||||||||||
FDFFieldIterator |
getFieldIterator(String field_name)
Get the field iterator.
| ||||||||||
FDFFieldIterator |
getFieldIterator()
An interactive form (sometimes referred to as an AcroForm) is a
collection of fields for gathering information interactively from
the user.
| ||||||||||
Obj |
getID()
Get the ID entry from "/Root/FDF" dictionary.
| ||||||||||
String |
getPDFFileName()
Get the PDF document file that this FDF file was exported from or is intended
to be imported into.
| ||||||||||
Obj |
getRoot()
Get the root.
| ||||||||||
SDFDoc |
getSDFDoc()
Get the SDFDoc object in FDFDoc
| ||||||||||
Obj |
getTrailer()
Get the trailer.
| ||||||||||
boolean |
isModified()
determine whether the document is modified
| ||||||||||
void |
mergeAnnots(String command_file)
Merges XFDF annotations into FDF document.
| ||||||||||
void |
mergeAnnots(String command_file, String permitted_user)
Merges XFDF annotations into FDF document.
| ||||||||||
void |
save(OutputStream stream)
Saves the document to a an OutputStream.
| ||||||||||
void |
save(OutputStream stream, int size)
Saves the document to a an OutputStream.
| ||||||||||
void |
save(String path)
Saves the document to a file.
| ||||||||||
byte[] |
save()
Saves the document to a memory buffer.
| ||||||||||
void |
saveAsXFDF(String path)
Save a FDF document in XFDF format.
| ||||||||||
String |
saveAsXFDF()
Save a FDF document in XFDF format and returns the XFDF string
| ||||||||||
String |
saveAsXFDF(XFDFExportOptions opts)
Save a FDF document in XFDF format and returns the XFDF string
| ||||||||||
void |
saveAsXFDF(String path, XFDFExportOptions opts)
Save a FDF document in XFDF format.
| ||||||||||
void |
setID(Obj id)
Set the ID entry in "/Root/FDF" dictionary.
| ||||||||||
void |
setPDFFileName(String filepath)
Set the PDF document file that this FDF file was exported from or is intended
to be imported into.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Create a FDF document from an existing SDF/Cos document.
sdfdoc | An SDF document. Created FDFDoc will take the ownership of the low-level document. |
---|
PDFNetException |
---|
Open an existing FDF document.
Note: if the input stream doesn't support Seek() operation the document will load whole data stream in memory before parsing. In case of linearized FDF, the document may be parsed on-the-fly while it is being loaded in memory. Note that since StdFile implements Seek() interface, the document does not have to be fully in memory before it is used. Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream | input stream containing a serialized document. The input stream may be a random-access file, memory buffer, slow HTTP connection etc. |
---|
PDFNetException |
---|
Open a SDF/Cos document from a memory buffer.
Note: the document should be fully loaded in the memory buffer.
buf | a memory buffer containing the serialized document |
---|
PDFNetException |
---|
Open an existing FDF document from an InputStream.
Note: Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream | - input stream containing a serialized document. |
---|
PDFNetException | |
---|---|
IOException | Signals that an I/O exception has occurred. |
Open an existing FDF document from an InputStream.
Note: Make sure to call InitSecurityHandler() after FDFDoc(...) for encrypted documents.
stream | - input stream containing a serialized document. |
---|---|
size | - the expected size of the input stream. |
PDFNetException | |
---|---|
IOException | Signals that an I/O exception has occurred. |
Create a new FDFDoc from XFDF input. Input can be either a XFDF file path, or the XFDF data itself.
xfdf | the string containing either the file path to a XFDF file, or the XML buffer containing the XFDF. |
---|
PDFNetException |
---|
Create a new interactive form FDFField.
field_name | the field_name |
---|---|
field_type | the field_type |
PDFNetException |
---|
Create a FDFField with specified name, type and string value
field_name | the field_name |
---|---|
field_type | the field_type |
field_value | the field_value |
PDFNetException |
---|
Create a FDFField with specified name, type and value
field_name | the field_name |
---|---|
field_type | the field_type |
field_value | the field_value |
PDFNetException |
---|
Get the FDF dictionary.
PDFNetException |
---|
field_name a string representing the fully qualified name of the field (e.g. "employee.name.first").
field_name | the field_name |
---|
PDFNetException |
---|
Get the field iterator.
field_name | the field_name |
---|
PDFNetException |
---|
An interactive form (sometimes referred to as an AcroForm) is a collection of fields for gathering information interactively from the user. A FDF document may contain any number of fields appearing on any combination of pages, all of which make up a single, global interactive form spanning the entire document. The following methods are used to access and manipulate Interactive form fields (sometimes referred to as AcroForms).
Note: if the document has no AcroForms, HasNext() will return false.
PDFNetException |
---|
Get the ID entry from "/Root/FDF" dictionary.
PDFNetException |
---|
Get the PDF document file that this FDF file was exported from or is intended to be imported into.
PDFNetException |
---|
Get the root. Note: This method will count as a document usage for consumption-based licensing if the current document has not yet been counted.
PDFNetException |
---|
Get the SDFDoc object in FDFDoc
Get the trailer. Note: This method will count as a document usage for consumption-based licensing if the current document has not yet been counted.
PDFNetException |
---|
determine whether the document is modified
PDFNetException |
---|
Merges XFDF annotations into FDF document.
command_file | the path to the xml command file, or the xml command itself |
---|
PDFNetException |
---|
Merges XFDF annotations into FDF document.
command_file | the path to the xml command file, or the xml command itself |
---|---|
permitted_user | the user name of the permitted user |
PDFNetException |
---|
Saves the document to a an OutputStream. Note: This method will count as a document usage for consumption-based licensing if the current document has not yet been counted.
stream | An OutputStream where the document should be serialized. |
---|
PDFNetException | |
---|---|
IOException | Signals that an I/O exception has occurred. |
Saves the document to a an OutputStream. Note: This method will count as a document usage for consumption-based licensing if the current document has not yet been counted.
stream | An OutputStream where the document should be serialized. |
---|---|
size | The expected size of the output stream. |
PDFNetException | |
---|---|
IOException | Signals that an I/O exception has occurred. |
Saves the document to a file. If a full save is requested to the original path, the file is saved to a file system-determined temporary file, the old file is deleted, and the temporary file is renamed to path. A full save with remove unused or linearization option may re-arrange object in the cross reference table. Therefore all pointers and references to document objects and resources should be re acquired in order to continue document editing. In order to use incremental save the specified path must match original path and e_incremental flag bit should be set. Note: This method will count as a document usage for consumption-based licensing if the current document has not yet been counted.
path | The full path name to which the file is saved. |
---|
PDFNetException |
---|
Saves the document to a memory buffer. Note: This method will count as a document usage for consumption-based licensing if the current document has not yet been counted.
PDFNetException |
---|
Save a FDF document in XFDF format and returns the XFDF string
PDFNetException |
---|
Save a FDF document in XFDF format and returns the XFDF string
PDFNetException |
---|
Save a FDF document in XFDF format.
path | the path |
---|---|
opts | Options controlling finer parameters of xfdf export |
PDFNetException |
---|
Set the PDF document file that this FDF file was exported from or is intended to be imported into.
filepath | pathname to the file. |
---|
PDFNetException |
---|