Class PDFNet.FDFDoc
PDFNet.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.
Constructor Attributes | Constructor Name and Description |
---|---|
PDFNet.FDFDoc(id)
FDFFieldIterator is an iterator type used to traverse interactive form fields
in a FDF document.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
PDFNet.FDFDoc.create()
Default constructor that creates an empty new document.
|
<static> |
PDFNet.FDFDoc.createFromMemoryBuffer(buf)
Open a SDF/Cos document from a memory buffer.
|
<static> |
PDFNet.FDFDoc.createFromStream(stream)
Open an existing FDF document
|
<static> |
PDFNet.FDFDoc.createFromXFDF(file_name)
Create a new FDFDoc from XFDF input.
|
destroy()
Destructor
|
|
fieldCreate(field_name, type, field_value)
Create a new interactive form FDFField.
|
|
fieldCreateFromString(field_name, type, field_value)
[Documentation Not Yet Added]
|
|
getFDF()
|
|
getField(field_name)
|
|
getFieldIterator(field_name)
An interactive form (sometimes referred to as an AcroForm) is a
collection of fields for gathering information interactively from
the user.
|
|
[Documentation Not Yet Added]
|
|
getID()
Get the ID entry from "/Root/FDF" dictionary.
|
|
Get the PDF document file that this FDF file was exported from or is intended
to be imported into.
|
|
getRoot()
|
|
mergeAnnots(command_file, permitted_user)
Merge the annotations from XFDF file into FDF file
|
|
Export FDF file as a XFDF string
|
|
Saves the document to a memory buffer.
|
|
setID(id)
Set the ID entry in "/Root/FDF" dictionary.
|
|
setPDFFileName(filepath)
Set the PDF document file that this FDF file was exported from or is intended
to be imported into.
|
Class Detail
PDFNet.FDFDoc(id)
FDFFieldIterator is an iterator type used to traverse interactive form fields
in a FDF document. A FDFFieldIterator points to FDF::FDFField nodes or to the 'null'
FDFField node. A sample use case:
- Parameters:
- id
Method Detail
<static>
{FDFDoc}
PDFNet.FDFDoc.create()
Default constructor that creates an empty new document.
- Returns:
- {FDFDoc} A promise that resolves to an object of type: "FDFDoc" (generated documentation)
<static>
{FDFDoc}
PDFNet.FDFDoc.createFromMemoryBuffer(buf)
Open a SDF/Cos document from a memory buffer.
- Parameters:
- {Array} buf
- a memory buffer containing the serialized document
- Returns:
- {FDFDoc} A promise that resolves to an object of type: "FDFDoc" (generated documentation)
<static>
{FDFDoc}
PDFNet.FDFDoc.createFromStream(stream)
Open an existing FDF document
- Parameters:
- {Filter} stream
- input stream containing a serialized document. The input stream may be a random-access file, memory buffer, slow HTTP connection etc.
- Returns:
- {FDFDoc} A promise that resolves to an object of type: "FDFDoc" (generated documentation)
<static>
{FDFDoc}
PDFNet.FDFDoc.createFromXFDF(file_name)
Create a new FDFDoc from XFDF input. Input can be either a XFDF file path, or the XFDF data itself.
- Parameters:
- {string} file_name
- string containing either the file path to a XFDF file, or the XML buffer containing the XFDF.
- Returns:
- {FDFDoc} A promise that resolves to a new FDFDoc.
destroy()
Destructor
{fdffield}
fieldCreate(field_name, type, field_value)
Create a new interactive form FDFField.
- Parameters:
- {string} field_name
- (generated documentation)
- {number/enum} type
- (generated enum documentation)
PDFNet.Field.Type = { e_button : 0 e_check : 1 e_radio : 2 e_text : 3 e_choice : 4 e_signature : 5 e_null : 6 }
- {Obj} field_value
- (generated documentation)
- Returns:
- {fdffield} A promise that resolves to
{fdffield}
fieldCreateFromString(field_name, type, field_value)
[Documentation Not Yet Added]
- Parameters:
- {string} field_name
- (generated documentation)
- {number/enum} type
- (generated enum documentation)
PDFNet.Field.Type = { e_button : 0 e_check : 1 e_radio : 2 e_text : 3 e_choice : 4 e_signature : 5 e_null : 6 }
- {string} field_value
- (generated documentation)
- Returns:
- {fdffield} A promise that resolves to an object of type: "fdffield" (generated documentation)
{Obj}
getFDF()
- Returns:
- {Obj} A promise that resolves to the FDF dictionary located in "/Root" or NULL if dictionary is not present.
{fdffield}
getField(field_name)
- Parameters:
- {string} field_name
- a string representing the fully qualified name of the field (e.g. "employee.name.first").
- Returns:
- {fdffield} A promise that resolves to a FDFField associated with the given field_name or invalid field (null) if the field is not found.
{Iterator}
getFieldIterator(field_name)
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).
- Parameters:
- {string} field_name
- (generated documentation)
- Returns:
- {Iterator} an iterator to the first Filed in the document.
{Iterator}
getFieldIteratorBegin()
[Documentation Not Yet Added]
- Returns:
- {Iterator} A promise that resolves to an object of type: "Iterator" (generated documentation)
{Obj}
getID()
Get the ID entry from "/Root/FDF" dictionary.
- Returns:
- {Obj} A promise that resolves to An object representing the ID entry in "/Root/FDF" dictionary.
{string}
getPDFFileName()
Get the PDF document file that this FDF file was exported from or is intended
to be imported into.
- Returns:
- {string} A promise that resolves to a String with the PDF document file name.
{Obj}
getRoot()
- Returns:
- {Obj} A promise that resolves to A dictionary representing the Cos root of the document (/Root entry within the trailer dictionary)
{SDFDoc}
getSDFDoc()
- Returns:
- {SDFDoc} A promise that resolves to document's SDF/Cos document
{Obj}
getTrailer()
- Returns:
- {Obj} A promise that resolves to A dictionary representing the Cos root of the document (document's trailer)
{boolean}
isModified()
- Returns:
- {boolean} A promise that resolves to true if document was modified, false otherwise
mergeAnnots(command_file, permitted_user)
Merge the annotations from XFDF file into FDF file
- Parameters:
- {string} command_file
- string containing the xml command file path or xml string of the command
- {string} permitted_user
- optional user name of the permitted user
{string}
saveAsXFDFAsString()
Export FDF file as a XFDF string
- Returns:
- {string} A promise that resolves to a UString containing the XFDF representation of the FDF file
saveMemoryBuffer()
Saves the document to a memory buffer.
setID(id)
Set the ID entry in "/Root/FDF" dictionary.
- Parameters:
- {Obj} id
- ID array object.
setPDFFileName(filepath)
Set the PDF document file that this FDF file was exported from or is intended
to be imported into.
- Parameters:
- {string} filepath
- pathname to the file.