com.foxit.sdk.fdf.FDFDoc Class Reference
Inheritance diagram for com.foxit.sdk.fdf.FDFDoc:
com.foxit.sdk.common.Base

Public Member Functions

 FDFDoc (FileReaderCallback file_read) throws com.foxit.sdk.PDFException
 Constructor, with a file read callback object.
More...
 
 FDFDoc (int type) throws com.foxit.sdk.PDFException
 Constructor.
More...
 
 FDFDoc (String path) throws com.foxit.sdk.PDFException
 Constructor, from an existing FDF or XFDF file path.
More...
 
 FDFDoc (byte[] buffer) throws com.foxit.sdk.PDFException
 Constructor, from a memory buffer.
More...
 
 FDFDoc (FDFDoc other)
 Constructor, with another FDFDoc object.
More...
 
PDFDictionary getCatalog () throws com.foxit.sdk.PDFException
 Get the catalog dictionary.
More...
 
PDFDictionary getFDFDict () throws com.foxit.sdk.PDFException
 Get the dictionary of "FDF" entry from catalog dictionary.
More...
 
String getPDFPath () throws com.foxit.sdk.PDFException
 Get the path of related PDF document.
More...
 
int getType () throws com.foxit.sdk.PDFException
 Get the type of current document object.
More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 
boolean saveAs (String file_path) throws com.foxit.sdk.PDFException
 Save current document as another FDF or XFDF file.
More...
 
boolean saveAs (FileWriterCallback file) throws com.foxit.sdk.PDFException
 Save current document as another FDF or XFDF file.
More...
 
boolean setPDFPath (String pdf_path) throws com.foxit.sdk.PDFException
 Set the path of related PDF document.
More...
 

Static Public Attributes

static final int e_FDF = 0
 FDF document type: FDF.

 
static final int e_XFDF = 1
 FDF document type: XFDF.

 

Detailed Description

FDF (Forms Data Format) is a kind of file format, used for interactive form data. FDF can be 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. Besides these, FDF can be used to define a container for annotations that are separated from the PDF document to which they apply.
XFDF(XML Forms Data Format) is a version of FDF based on XML. It has similar features with FDF.
In a word, FDF and XFDF contain the subset of a PDF document to describe interactive forms and annotations.
Class fdf::FDFDoc can be used to represent either FDF or XFDF. A fdf::FDFDoc object can be constructed with an existing file from file path, memory buffer, a custom implemented ReaderCallback object and an input file stream. A fdf::FDFDoc can also be constructed as a new FDF or XFDF document. This class also offers functions to get or set some information from FDF or XFDF file, and save current FDF/XFDF as another file.
To import or export form fields or annotations, please refer to functions pdf::PDFDoc::importFromFDF, pdf::PDFDoc::exportToFDF and pdf::PDFDoc::exportAnnotToFDF.

See also
pdf::PDFDoc

Constructor & Destructor Documentation

◆ FDFDoc() [1/5]

com.foxit.sdk.fdf.FDFDoc.FDFDoc ( FileReaderCallback  file_read) throws com.foxit.sdk.PDFException

Constructor, with a file read callback object.

Parameters
file_readPointer to a ReaderCallback object which is implemented by user to load a FDF or XFDF document. It should not be null.

◆ FDFDoc() [2/5]

com.foxit.sdk.fdf.FDFDoc.FDFDoc ( int  type) throws com.foxit.sdk.PDFException

Constructor.

This constructor is to construct a new fdf::FDFDoc object (without any data).

Parameters
typeFDF document type. It should be one of following values: fdf::e_FDF, {}

◆ FDFDoc() [3/5]

com.foxit.sdk.fdf.FDFDoc.FDFDoc ( String  path) throws com.foxit.sdk.PDFException

Constructor, from an existing FDF or XFDF file path.

Parameters
pathA full path of an existing FDF/XFDF file. It should not be an empty string.

◆ FDFDoc() [4/5]

com.foxit.sdk.fdf.FDFDoc.FDFDoc ( byte []  buffer) throws com.foxit.sdk.PDFException

Constructor, from a memory buffer.

Parameters
bufferA memory buffer. The FDF or XFDF file data should be fully loaded in this memory buffer. It should not be null.

◆ FDFDoc() [5/5]

com.foxit.sdk.fdf.FDFDoc.FDFDoc ( FDFDoc  other)

Constructor, with another FDFDoc object.

Parameters
otherAnother FDFDoc object.

Member Function Documentation

◆ getCatalog()

PDFDictionary com.foxit.sdk.fdf.FDFDoc.getCatalog ( ) throws com.foxit.sdk.PDFException

Get the catalog dictionary.

Note
If current object represents an XFDF document, this function will return null.
Returns
The catalog dictionary.

◆ getFDFDict()

PDFDictionary com.foxit.sdk.fdf.FDFDoc.getFDFDict ( ) throws com.foxit.sdk.PDFException

Get the dictionary of "FDF" entry from catalog dictionary.

Note
If current object represents an XFDF document, this function will return null.
Returns
The dictionary of "FDF" entry from catalog dictionary.

◆ getPDFPath()

String com.foxit.sdk.fdf.FDFDoc.getPDFPath ( ) throws com.foxit.sdk.PDFException

Get the path of related PDF document.

The path can be either an absolute one, or a relative one.

Returns
Path of related PDF document. Empty string means no such information is found.

◆ getType()

int com.foxit.sdk.fdf.FDFDoc.getType ( ) throws com.foxit.sdk.PDFException

Get the type of current document object.

Returns
FDF document type. It would be one of following values: fdf::e_FDF, fdf::e_XFDF.

◆ isEmpty()

boolean com.foxit.sdk.fdf.FDFDoc.isEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ saveAs() [1/2]

boolean com.foxit.sdk.fdf.FDFDoc.saveAs ( String  file_path) throws com.foxit.sdk.PDFException

Save current document as another FDF or XFDF file.

Parameters
file_pathA full path of the new saved FDF or XFDF file. It should not be an empty string.
Returns
true means success, while false means failure.
Note
This function does not support to save current FDF object just back to the FDF or XFDF file which is used to construct current FDF object. In order to do so, user is recommended to do as following steps:
Assume that current FDF object is constructed from a FDF file named "org.fdf".

Use current function to save current FDF object to an temporary file. Here, this temporary file is named as "temp.tmp".
Ensure that current FDF object has destructed.
Remove "org.fdf" and rename "temp.tmp" to "org.fdf".

◆ saveAs() [2/2]

boolean com.foxit.sdk.fdf.FDFDoc.saveAs ( FileWriterCallback  file) throws com.foxit.sdk.PDFException

Save current document as another FDF or XFDF file.

Parameters
fileA WriterCallback object which is implemented by user to save FDF or XFDF file.
Returns
true means success, while false means failure.
Note
This function does not support to save current FDF object just back to the FDF or XFDF file which is used to construct current FDF object. In order to do so, user is recommended to do as following steps:
Assume that current FDF object is constructed from a FDF file named "org.fdf".

Use current function to save current FDF object to an temporary file. Here, this temporary file is named as "temp.tmp".
Ensure that current FDF object has destructed.
Remove "org.fdf" and rename "temp.tmp" to "org.fdf".

◆ setPDFPath()

boolean com.foxit.sdk.fdf.FDFDoc.setPDFPath ( String  pdf_path) throws com.foxit.sdk.PDFException

Set the path of related PDF document.

Parameters
pdf_pathThe path of related PDF document. It can be either an absolute path or a relative path. It should not be an empty string.
Returns
true means success, while false means failure.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.