XFA

Inheritance: java.lang.Object

public final class XFA

Represents XML form regarding XML Forms Architecture (XFA).

Methods

MethodDescription
getTemplate()XFA Template component of an XFA form.
tryGetTemplateString(String value)Tries to export calculation script from XFA form.
getForm()Gets XFA Form Component of an XFA form.
getDatasets()XFA Datasets component of an XFA form.
getConfig()XFA Config component of an XFA form.
getXDP()XML Data Package (all XFA form components within a surrounding XML container).
get_Item(String path)Gets data node value according path .
set_Item(String path, String value)Gets data node value according path .
getFieldNames()List of field names in the form template.
getFieldTemplate(String fieldName)Returns XML node of XFA field tempalte.
getFieldTemplates()Returns list of all field templates on XFA form.
getNamespaceManager()Returns namespace manager with namespaces used for template and data.
getNamespaceManager_()Gets the namespace for the XFA form.
flattenXfaField(System.Xml.XmlNode field)Flatten field of XFA form.
beginCachedUpdates()Start cached updates mode.
endCachedUpdates()Ends cahced updates and saves all data into document structure.
setFieldImage(String fieldName, InputStream image)Sets image for XFA field.
setFieldImageInternal(String fieldName, System.IO.Stream image)
getFieldsWithTextValuesMap()Returns map with short field name and it’s string value for all fields.
getXfaField(String path)

getTemplate()

public System.Xml.XmlNode getTemplate()

XFA Template component of an XFA form.

Returns: com.aspose.ms.System.Xml.XmlNode - XmlNode object

tryGetTemplateString(String value)

public String tryGetTemplateString(String value)

Tries to export calculation script from XFA form. Otherwise returns the empty string;

Parameters:

ParameterTypeDescription
valuejava.lang.StringThe tag name

Returns: java.lang.String - String instance

getForm()

public System.Xml.XmlNode getForm()

Gets XFA Form Component of an XFA form.

Returns: com.aspose.ms.System.Xml.XmlNode - XmlNode object

getDatasets()

public System.Xml.XmlNode getDatasets()

XFA Datasets component of an XFA form.

Returns: com.aspose.ms.System.Xml.XmlNode - XmlNode object

getConfig()

public System.Xml.XmlNode getConfig()

XFA Config component of an XFA form.

Returns: com.aspose.ms.System.Xml.XmlNode - XmlNode object

getXDP()

public System.Xml.XmlDocument getXDP()

XML Data Package (all XFA form components within a surrounding XML container).

Returns: com.aspose.ms.System.Xml.XmlDocument - XmlDocument object

get_Item(String path)

public String get_Item(String path)

Gets data node value according path .

Parameters:

ParameterTypeDescription
pathjava.lang.StringData node path, e.g. form1[0].Subform1[0].Subform2[0].Subform3[0].TextField[0]. Be sure to include indices even if data contains only single occurences of each nodes, i.e. write node1[0].node2[0]… instead of node1.node2…

Returns: java.lang.String - Data node value.

set_Item(String path, String value)

public void set_Item(String path, String value)

Gets data node value according path .

Parameters:

ParameterTypeDescription
pathjava.lang.StringString value
valuejava.lang.StringString value

getFieldNames()

public String[] getFieldNames()

List of field names in the form template.

Returns: java.lang.String[] - array of String values

getFieldTemplate(String fieldName)

public System.Xml.XmlNode getFieldTemplate(String fieldName)

Returns XML node of XFA field tempalte.

Parameters:

ParameterTypeDescription
fieldNamejava.lang.StringPath of the field which template must be found.

Returns: com.aspose.ms.System.Xml.XmlNode - XL node with field template.

getFieldTemplates()

public System.Xml.XmlNodeList getFieldTemplates()

Returns list of all field templates on XFA form.

Returns: com.aspose.ms.System.Xml.XmlNodeList - List of field templates.

getNamespaceManager()

public System.Xml.XmlNamespaceManager getNamespaceManager()

Returns namespace manager with namespaces used for template and data.

Returns: com.aspose.ms.System.Xml.XmlNamespaceManager - XmlNamespaceManager object

getNamespaceManager_()

public System.Xml.XmlNamespaceManager getNamespaceManager_()

Gets the namespace for the XFA form. The following namepsaces are defined: “data” for form data and “tpl” for form template.

Returns: com.aspose.ms.System.Xml.XmlNamespaceManager - XmlNamespaceManager object

flattenXfaField(System.Xml.XmlNode field)

public static void flattenXfaField(System.Xml.XmlNode field)

Flatten field of XFA form.

Parameters:

ParameterTypeDescription
fieldcom.aspose.ms.System.Xml.XmlNodeXFA form field node.

beginCachedUpdates()

public void beginCachedUpdates()

Start cached updates mode. All changes made to XFA will be cached and saved into document structure at EndCachedUpdates call. This allows to improve preformacne by avoiding redudant operations on saving XML packets into document when a lot of changes to XFA are made.

endCachedUpdates()

public void endCachedUpdates()

Ends cahced updates and saves all data into document structure.

setFieldImage(String fieldName, InputStream image)

public void setFieldImage(String fieldName, InputStream image)

Sets image for XFA field.

Parameters:

ParameterTypeDescription
fieldNamejava.lang.StringName of the field.
imagejava.io.InputStreamStream which contains image.

setFieldImageInternal(String fieldName, System.IO.Stream image)

public void setFieldImageInternal(String fieldName, System.IO.Stream image)

Parameters:

ParameterTypeDescription
fieldNamejava.lang.String
imagecom.aspose.ms.System.IO.Stream

getFieldsWithTextValuesMap()

public HashMap<String,String> getFieldsWithTextValuesMap()

Returns map with short field name and it’s string value for all fields.

Returns: java.util.HashMap<java.lang.String,java.lang.String> - HashMap object

getXfaField(String path)

public final XfaFieldInteractive getXfaField(String path)

Parameters:

ParameterTypeDescription
pathjava.lang.String

Returns: com.aspose.pdf.XfaFieldInteractive