Class: FDFDoc

PDFNet. FDFDoc


new 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.

Extends

Methods


<static> create()

Default constructor that creates an empty new document.
Returns:
A promise that resolves to an object of type: "PDFNet.FDFDoc"
Type
Promise.<PDFNet.FDFDoc>

<static> createFromMemoryBuffer(buf)

Open a SDF/Cos document from a memory buffer.
Parameters:
Name Type Description
buf ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray a memory buffer containing the serialized document
Returns:
A promise that resolves to an object of type: "PDFNet.FDFDoc"
Type
Promise.<PDFNet.FDFDoc>

<static> createFromStream(stream)

Parameters:
Name Type Description
stream PDFNet.Filter
Returns:
A promise that resolves to an object of type: "PDFNet.FDFDoc"
Type
Promise.<PDFNet.FDFDoc>

<static> createFromXFDF(file_name)

Create a new FDFDoc from XFDF input. Input can be either a XFDF file path, or the XFDF data itself.
Parameters:
Name Type Description
file_name string string containing either the file path to a XFDF file, or the XML buffer containing the XFDF.
Returns:
A promise that resolves to a new FDFDoc.
Type
Promise.<PDFNet.FDFDoc>

destroy()

Destructor
Inherited From:
Returns:
Type
Promise.<void>

fieldCreate(field_name, type [, field_value])

Parameters:
Name Type Argument Description
field_name string
type number
PDFNet.Field.Type = {
	e_button : 0
	e_check : 1
	e_radio : 2
	e_text : 3
	e_choice : 4
	e_signature : 5
	e_null : 6
}
field_value PDFNet.Obj <optional>
Returns:
A promise that resolves to an object of type: "PDFNet.FDFField"
Type
Promise.<PDFNet.FDFField>

fieldCreateFromString(field_name, type, field_value)

Parameters:
Name Type Description
field_name string
type number
PDFNet.Field.Type = {
	e_button : 0
	e_check : 1
	e_radio : 2
	e_text : 3
	e_choice : 4
	e_signature : 5
	e_null : 6
}
field_value string
Returns:
A promise that resolves to an object of type: "PDFNet.FDFField"
Type
Promise.<PDFNet.FDFField>

getFDF()

Returns:
A promise that resolves to the FDF dictionary located in "/Root" or NULL if dictionary is not present.
Type
Promise.<PDFNet.Obj>

getField(field_name)

Parameters:
Name Type Description
field_name string a string representing the fully qualified name of the field (e.g. "employee.name.first").
Returns:
A promise that resolves to a FDFField associated with the given field_name or invalid field (null) if the field is not found.
Type
Promise.<PDFNet.FDFField>

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:
Name Type Description
field_name string String representing the name of the FDFField to get.
Returns:
A promise that resolves to an iterator to the FDFField in the document.
Type
Promise.<PDFNet.Iterator.<PDFNet.FDFField>>

getFieldIteratorBegin()

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).
Returns:
A promise that resolves to an iterator to the first FDFField in the document.
Type
Promise.<PDFNet.Iterator.<PDFNet.FDFField>>

getID()

Get the ID entry from "/Root/FDF" dictionary.
Returns:
A promise that resolves to An object representing the ID entry in "/Root/FDF" dictionary.
Type
Promise.<PDFNet.Obj>

getPDFFileName()

Get the PDF document file that this FDF file was exported from or is intended to be imported into.
Returns:
A promise that resolves to a String with the PDF document file name.
Type
Promise.<string>

getRoot()

Returns:
A promise that resolves to A dictionary representing the Cos root of the document (/Root entry within the trailer dictionary)
Type
Promise.<PDFNet.Obj>

getSDFDoc()

Returns:
A promise that resolves to document's SDF/Cos document
Type
Promise.<PDFNet.SDFDoc>

getTrailer()

Returns:
A promise that resolves to A dictionary representing the Cos root of the document (document's trailer)
Type
Promise.<PDFNet.Obj>

isModified()

Returns:
A promise that resolves to true if document was modified, false otherwise
Type
Promise.<boolean>

mergeAnnots(command_file [, permitted_user])

Merge the annotations from XFDF file into FDF file
Parameters:
Name Type Argument Description
command_file string string containing the xml command file path or xml string of the command
permitted_user string <optional>
optional user name of the permitted user
Returns:
Type
Promise.<void>

saveAsXFDFAsString()

Export FDF file as a XFDF string
Returns:
A promise that resolves to a UString containing the XFDF representation of the FDF file
Type
Promise.<string>

saveMemoryBuffer()

Saves the document to a memory buffer.
Returns:
A promise that resolves to an object of type: "Uint8Array"
Type
Promise.<Uint8Array>

setID(id)

Set the ID entry in "/Root/FDF" dictionary.
Parameters:
Name Type Description
id PDFNet.Obj ID array object.
Returns:
Type
Promise.<void>

setPDFFileName(filepath)

Set the PDF document file that this FDF file was exported from or is intended to be imported into.
Parameters:
Name Type Description
filepath string pathname to the file.
Returns:
Type
Promise.<void>

takeOwnership()

Take the ownership of this object, so that PDFNet.runWithCleanup won't destroy this object.
Inherited From:
Returns:
Type
void