Table of Contents

Class XfaForm

Namespace
iTextSharp.text.pdf
Assembly
iTextSharp.LGPLv2.Core.dll

Processes XFA forms. @author Paulo Soares (psoares@consiste.pt)

public class XfaForm
Inheritance
XfaForm
Inherited Members

Constructors

XfaForm()

An empty constructor to build on.

public XfaForm()

XfaForm(PdfReader)

A constructor from a PdfReader . It basically does everything from finding the XFA stream to the XML parsing. @throws java.io.IOException on error @throws javax.xml.parsers.ParserConfigurationException on error @throws org.xml.sax.SAXException on error

public XfaForm(PdfReader reader)

Parameters

reader PdfReader

the reader

Fields

XFA_DATA_SCHEMA

public const string XFA_DATA_SCHEMA = "http://www.xfa.org/schema/xfa-data/1.0/"

Field Value

string

Properties

AcroFieldsSom

Gets the class that contains the "classic" fields processing.

public XfaForm.AcroFieldsSearch AcroFieldsSom { get; set; }

Property Value

XfaForm.AcroFieldsSearch

the class that contains the "classic" fields processing

Changed

Checks if this XFA form was changed.

public bool Changed { get; set; }

Property Value

bool

true if this XFA form was changed

DatasetsNode

Gets the Node that corresponds to the datasets part.

public XmlNode DatasetsNode { get; }

Property Value

XmlNode

the Node that corresponds to the datasets part

DatasetsSom

Gets the class that contains the datasets processing section of the XFA.

public XfaForm.Xml2SomDatasets DatasetsSom { get; set; }

Property Value

XfaForm.Xml2SomDatasets

the class that contains the datasets processing section of the XFA

DomDocument

Gets the top level DOM document.

public XmlDocument DomDocument { get; set; }

Property Value

XmlDocument

the top level DOM document

Reader

Sets the PdfReader to be used by this instance.

public PdfReader Reader { get; set; }

Property Value

PdfReader

TemplateSom

Gets the class that contains the template processing section of the XFA.

public XfaForm.Xml2SomTemplate TemplateSom { get; set; }

Property Value

XfaForm.Xml2SomTemplate

the class that contains the template processing section of the XFA

XfaPresent

Returns true if it is a XFA form.

public bool XfaPresent { get; set; }

Property Value

bool

true if it is a XFA form

Methods

FindDatasetsName(string)

Finds the complete SOM name contained in the datasets section from a possibly partial name.

public string FindDatasetsName(string name)

Parameters

name string

the complete or partial name

Returns

string

the complete name or null if not found

FindDatasetsNode(string)

Finds the Node contained in the datasets section from a possibly partial name.

public XmlNode FindDatasetsNode(string name)

Parameters

name string

the complete or partial name

Returns

XmlNode

the Node or null if not found

FindFieldName(string, AcroFields)

Finds the complete field name contained in the "classic" forms from a partial name.

public string FindFieldName(string name, AcroFields af)

Parameters

name string

the complete or partial name

af AcroFields

the fields

Returns

string

the complete name or null if not found

GetNodeText(XmlNode)

Gets all the text contained in the child nodes of this node.

public static string GetNodeText(XmlNode n)

Parameters

n XmlNode

the Node

Returns

string

the text found or "" if no text was found

GetXfaObject(PdfReader)

Return the XFA Object, could be an array, could be a Stream. Returns null f no XFA Object is present. @since 2.1.3

public static PdfObject GetXfaObject(PdfReader reader)

Parameters

reader PdfReader

a PdfReader instance

Returns

PdfObject

the XFA object

SerializeDoc(XmlNode)

Serializes a XML document to a byte array. @throws java.io.IOException on error

public static byte[] SerializeDoc(XmlNode n)

Parameters

n XmlNode

the XML document

Returns

byte[]

the serialized XML document

SetNodeText(XmlNode, string)

Sets the text of this node. All the child's node are deleted and a new child text node is created.

public void SetNodeText(XmlNode n, string text)

Parameters

n XmlNode

the Node to add the text to

text string

the text to add

SetXfa(PdfWriter)

Sets the XFA key from the instance data. The old XFA is erased. @throws java.io.IOException on error

public void SetXfa(PdfWriter writer)

Parameters

writer PdfWriter

the writer

SetXfa(XfaForm, PdfReader, PdfWriter)

Sets the XFA key from a byte array. The old XFA is erased. @throws java.io.IOException on error

public static void SetXfa(XfaForm form, PdfReader reader, PdfWriter writer)

Parameters

form XfaForm

the data

reader PdfReader

the reader

writer PdfWriter

the writer