Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FoxitPDFSDKPython3.FDFDoc Class Reference
Inheritance diagram for FoxitPDFSDKPython3.FDFDoc:

## Public Member Functions
def | FDFDoc (file_read)
| Constructor, with a file read callback object. More...
def | FDFDoc (type)
| Constructor. More...
def | FDFDoc (path)
| Constructor, from an existing FDF or XFDF file path. More...
def | FDFDoc (buffer, length)
| Constructor, from a memory buffer. More...
def | FDFDoc (other)
| Constructor, with another FDF document object. More...
def | GetCatalog ()
| Get the catalog dictionary. More...
def | GetFDFDict ()
| Get the dictionary of "FDF" entry from catalog dictionary. More...
def | GetPDFPath ()
| Get the path of related PDF document. More...
def | GetType ()
| Get the type of current document object. More...
def | IsEmpty ()
| Check whether current object is empty or not. More...
def | SaveAs (file_path)
| Save current document as another FDF or XFDF file. More...
def | SaveAs (file)
| Save current document as another FDF or XFDF file. More...
def | SetPDFPath (pdf_path)
| Set the path of related PDF document. More...

## Static Public Attributes
| e_FDF = _fsdk.FDFDoc_e_FDF
| FDF document type: FDF.
| e_XFDF = _fsdk.FDFDoc_e_XFDF
| 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 FDFDoc can be used to represent either FDF or XFDF. A FDF document object can be constructed with an existing file from file path, memory buffer, a custom implemented FoxitPDFSDKPython3.FileReaderCallback object and an input file stream. A FDF document object 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 FoxitPDFSDKPython3.PDFDoc.ImportFromFDF , FoxitPDFSDKPython3.PDFDoc.ExportToFDF and FoxitPDFSDKPython3.PDFDoc.ExportAnnotToFDF .

See also
  FoxitPDFSDKPython3.PDFDoc

## Constructor & Destructor Documentation

## ◆ FDFDoc() [1/5]

def FoxitPDFSDKPython3.FDFDoc.FDFDoc | ( |  | file_read | ) |

Constructor, with a file read callback object.

Parameters

  [in] | file_read | Pointer to a FoxitPDFSDKPython3.FileReaderCallback object which is implemented by user to load a FDF or XFDF document. It should not be null.

## ◆ FDFDoc() [2/5]

def FoxitPDFSDKPython3.FDFDoc.FDFDoc | ( |  | type | ) |

Constructor.

This constructor is to construct a new FDF document object (without any data).

Parameters

  [in] | type | FDF document type. It should be one of following values: FoxitPDFSDKPython3.FDFDoc.e_FDF , FoxitPDFSDKPython3.FDFDoc.e_XFDF

## ◆ FDFDoc() [3/5]

def FoxitPDFSDKPython3.FDFDoc.FDFDoc | ( |  | path | ) |

Constructor, from an existing FDF or XFDF file path.

Parameters

  [in] | path | A full path of an existing FDF/XFDF file. It should not be an empty string.

## ◆ FDFDoc() [4/5]

def FoxitPDFSDKPython3.FDFDoc.FDFDoc | ( |  | buffer,
|  |  | length
| ) |  |

Constructor, from a memory buffer.

Parameters

  [in] | buffer | A memory buffer. The FDF or XFDF file data should be fully loaded in this memory buffer. It should not be null.
  [in] | length | The size of memory buffer. It should be above 0.

## ◆ FDFDoc() [5/5]

def FoxitPDFSDKPython3.FDFDoc.FDFDoc | ( |  | other | ) |

Constructor, with another FDF document object.

Parameters

  [in] | other | Another FDF document object.

## Member Function Documentation

## ◆ GetCatalog()

def FoxitPDFSDKPython3.FDFDoc.GetCatalog | ( |  | ) |

Get the catalog dictionary.

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

## ◆ GetFDFDict()

def FoxitPDFSDKPython3.FDFDoc.GetFDFDict | ( |  | ) |

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

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

## ◆ GetPDFPath()

def FoxitPDFSDKPython3.FDFDoc.GetPDFPath | ( |  | ) |

Get the path of related PDF document.

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

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

## ◆ GetType()

def FoxitPDFSDKPython3.FDFDoc.GetType | ( |  | ) |

Get the type of current document object.

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

## ◆ IsEmpty()

def FoxitPDFSDKPython3.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]

def FoxitPDFSDKPython3.FDFDoc.SaveAs | ( |  | file_path | ) |

Save current document as another FDF or XFDF file.

Parameters

  [in] | file_path | A 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".

  1. Use current function to save current FDF object to an temporary file. Here, this temporary file is named as "temp.tmp".

  2. Ensure that current FDF object has destructed.

  3. Remove "org.fdf" and rename "temp.tmp" to "org.fdf".

## ◆ SaveAs() [2/2]

def FoxitPDFSDKPython3.FDFDoc.SaveAs | ( |  | file | ) |

Save current document as another FDF or XFDF file.

Parameters

  [in] | file | A FoxitPDFSDKPython3.FileWriterCallback 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".

  1. Use current function to save current FDF object to an temporary file. Here, this temporary file is named as "temp.tmp".

  2. Ensure that current FDF object has destructed.

  3. Remove "org.fdf" and rename "temp.tmp" to "org.fdf".

## ◆ SetPDFPath()

def FoxitPDFSDKPython3.FDFDoc.SetPDFPath | ( |  | pdf_path | ) |

Set the path of related PDF document.

Parameters

  [in] | pdf_path | The 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.