SetaPDF_FormFiller_Xfa Class offering access to XFA data of a PDF form.

File: /SetaPDF v2/FormFiller/Xfa.php

Class hierarchy

Summary

Properties

$_bridge

$_data

The data node.

$_dataNodeUpdated

Flag indicating if the data has to be set back to the data stream on save.

$_domDocument

The document instance of the full XDP packet.

$_form

The form node.

$_formFiller

The form filler instance

$_setValueIsActive

Flag identicating that a setValue() process is working.

$_template

The template node.

$_templateNodeUpdated

Flag indicating that the template node was changed.


Methods

__construct()

The constructor.

Parameters
$formFiller : SetaPDF_FormFiller

The form filler instance

_evaluateValue()

private SetaPDF_FormFiller_Xfa::_evaluateValue (
$value, DOMElement $fieldNode
):

Evaluates a native value to a data value.

Parameters
$value
 
$fieldNode : DOMElement
 

_findPacketStream()

private SetaPDF_FormFiller_Xfa::_findPacketStream (
SetaPDF_Core_Type_Array $array, $name [, $create = false ]
):

Finds a packets stream by its name.

Parameters
$array : SetaPDF_Core_Type_Array
 
$name
 
$create
 

_setValueInForm()

protected SetaPDF_FormFiller_Xfa::_setValueInForm (
$fieldName, $value
):

Creates the data node and sets the value in the form package.

Parameters
$fieldName
 
$value
 
Exceptions

Throws SetaPDF_FormFiller_Exception

cleanUp()

public SetaPDF_FormFiller_Xfa::cleanUp (
void
):

Releases memory and resources.

getBridge()

Get the XFA bridge helper object.

Exceptions

Throws SetaPDF_FormFiller_Exception

getData()

public SetaPDF_FormFiller_Xfa::getData (
[ $create = false ]
):

Get the data node.

Parameters
$create
 

getDomDocument()

Get the DOMDocument instance of the XFA structure.

Exceptions

Throws SetaPDF_FormFiller_Exception

getFormFiller()

Get the form filler instance.

getFormNode()

Get the form node.

Exceptions

Throws SetaPDF_FormFiller_Exception

getFormNodeChecksum()

Calculate and get the checksum for the form node.

Exceptions

Throws SetaPDF_FormFiller_Exception

getObject()

Get the XFA pdf object.

Exceptions

Throws SetaPDF_Core_SecHandler_Exception

getTemplate()

Gets the template node from the XFA structure.

Exceptions

Throws SetaPDF_FormFiller_Exception

getXml()

public SetaPDF_FormFiller_Xfa::getXml (
void
):

Get the raw XFA (XML/XMP) data from the PDF document.

getXmp()

public SetaPDF_FormFiller_Xfa::getXmp (
void
):

Get the raw XFA (XML/XMP) from the PDF document.

See

isDynamic()

Checks if the XFA form is a dynamic or static form.

saveFormNode()

Saves the form node to the XFA packages.

Exceptions

Throws SetaPDF_FormFiller_Exception

Throws SetaPDF_Core_SecHandler_Exception

saveTemplate()

public SetaPDF_FormFiller_Xfa::saveTemplate (
[ $onlyIfUpdated = false ]
):

Saves the template node to the PDF structure.

Parameters
$onlyIfUpdated

Save only if the template node was updated internally.

setData()

public SetaPDF_FormFiller_Xfa::setData (
$xml
): void

Set the content of the data node.

Parameters
$xml
 
Exceptions

Throws SetaPDF_FormFiller_Exception

Throws Exception

setDefaultValue()

public SetaPDF_FormFiller_Xfa::setDefaultValue (
$fieldName, $value [, $encoding = 'UTF-8' ]
):

Set the default value for a specific field.

Parameters
$fieldName
 
$value
 
$encoding
 

setReadOnly()

public SetaPDF_FormFiller_Xfa::setReadOnly (
$fieldName, $readOnly
):

Set a field to read-only or to "open".

This method is called internally by the SetaPDF_FormFiller_Field_AbstractField::setReadOnly() method.

Parameters
$fieldName
 
$readOnly
 

setValue()

public SetaPDF_FormFiller_Xfa::setValue (
$fieldName, $value [, $encoding = 'UTF-8' ]
):

Sets a value by a field name.

This method is called internally if a fields value is changed to keep the XML data in sync. It should be used manually with care.

Parameters
$fieldName
 
$value
 
$encoding
 

setXml()

public SetaPDF_FormFiller_Xfa::setXml (
$domDocumentOrXml
): void

Set the raw XFA (XML/XMP) structure.

Parameters
$domDocumentOrXml
 
Exceptions

Throws SetaPDF_FormFiller_Exception

setXmp()

public SetaPDF_FormFiller_Xfa::setXmp (
$domDocumentOrXml
): void

Set the raw XFA (XML/XMP) structure.

Parameters
$domDocumentOrXml
 
See

syncAcroFormFields()

Syncornizes the XFA form field values with the corresponding AcroForm fields.

If XML data were passed via the SetaPDF_FormFiller_Xfa::setData() method this method will ensure that the data in the corresponding AcroForm fields representations will get updated.

syncDataNode()

Writes the data node back to the PDF document.