iText 9.5.0 API
iText.Forms.Xfa.XfaForm Class Reference

Processes XFA forms. More...

Public Member Functions

  XfaForm ()
  An empty constructor to build on. More...
 
  XfaForm (Stream inputStream)
  Creates an XFA form by the stream containing all xml information More...
 
  XfaForm (XDocument domDocument)
  Creates an XFA form by the Document containing all xml information More...
 
  XfaForm (PdfDictionary acroFormDictionary)
  A constructor from a iText.Kernel.Pdf.PdfDictionary . It is assumed, but not necessary for correct initialization, that the dictionary is actually a iText.Forms.PdfAcroForm . An entry in the dictionary with the More...
 
  XfaForm (PdfDocument pdfDocument)
  A constructor from a More...
 
virtual void  Write (PdfDocument document)
  Write the XfaForm to the provided PdfDocument. More...
 
virtual void  Write (PdfAcroForm acroForm)
  Write the XfaForm to the provided PdfDocument. More...
 
virtual void  SetXfaFieldValue (String name, String value)
  Changes a field value in the XFA form. More...
 
virtual String  GetXfaFieldValue (String name)
  Gets the xfa field value. More...
 
virtual bool  IsXfaPresent ()
  Returns More...
 
virtual String  FindFieldName (String name)
  Finds the complete field name from a partial name. More...
 
virtual String  FindDatasetsName (String name)
  Finds the complete SOM name contained in the datasets section from a possibly partial name. More...
 
virtual XNode  FindDatasetsNode (String name)
  Finds the More...
 
virtual String  GetNodeTextByPath (String path)
  Gets all the text contained in the child nodes of the node under the provided path. More...
 
virtual void  SetNodeText (XNode n, String text)
  Sets the text of this node. More...
 
virtual XDocument  GetDomDocument ()
  Gets the top level DOM document. More...
 
virtual void  SetDomDocument (XDocument domDocument)
  Sets the top DOM document. More...
 
virtual XElement  GetDatasetsNode ()
  Gets the More...
 
virtual void  FillXfaForm (FileInfo file)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (FileInfo file, bool readOnly)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (Stream @is)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (Stream @is, bool readOnly)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (XmlReader @is)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (XmlReader @is, bool readOnly)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (XNode node)
  Replaces the XFA data under datasets/data. More...
 
virtual void  FillXfaForm (XNode node, bool readOnly)
  Replaces the XFA data under datasets/data. More...
 

Static Public Member Functions

static void  SetXfaForm (XfaForm form, PdfDocument pdfDocument)
  Sets the XFA key from a byte array. More...
 
static void  SetXfaForm (XfaForm form, PdfAcroForm acroForm)
  Sets the XFA key from a byte array. More...
 
static IDictionary< String, XNode >  ExtractXFANodes (XDocument domDocument)
  Extracts DOM nodes from an XFA document. More...
 
static String  GetNodeText (XNode n)
  Gets all the text contained in the child nodes of this node. More...
 

Static Public Attributes

const String  XFA_DATA_SCHEMA = "http://www.xfa.org/schema/xfa-data/1.0/"
  The URI for the XFA Data schema. More...
 

Detailed Description

Processes XFA forms.

Constructor & Destructor Documentation

◆ XfaForm() [1/5]

iText.Forms.Xfa.XfaForm.XfaForm ( )
inline

An empty constructor to build on.

◆ XfaForm() [2/5]

iText.Forms.Xfa.XfaForm.XfaForm ( Stream  inputStream )
inline

Creates an XFA form by the stream containing all xml information

Parameters
inputStream The InputStream

◆ XfaForm() [3/5]

iText.Forms.Xfa.XfaForm.XfaForm ( XDocument  domDocument )
inline

Creates an XFA form by the Document containing all xml information

Parameters
domDocument The document

◆ XfaForm() [4/5]

iText.Forms.Xfa.XfaForm.XfaForm ( PdfDictionary  acroFormDictionary )
inline

A constructor from a iText.Kernel.Pdf.PdfDictionary . It is assumed, but not necessary for correct initialization, that the dictionary is actually a iText.Forms.PdfAcroForm . An entry in the dictionary with the

XFA key must contain correct XFA syntax. If the XFA key is absent, then the constructor essentially does nothing.

Parameters
acroFormDictionary the dictionary object to initialize from

◆ XfaForm() [5/5]

iText.Forms.Xfa.XfaForm.XfaForm ( PdfDocument  pdfDocument )
inline

A constructor from a

PdfDocument.

A constructor from a

PdfDocument. It basically does everything
from finding the XFA stream to the XML parsing.
"pdfDocument">the PdfDocument instance

Member Function Documentation

◆ ExtractXFANodes()

static IDictionary iText.Forms.Xfa.XfaForm.ExtractXFANodes ( XDocument  domDocument )
inlinestatic

Extracts DOM nodes from an XFA document.

Parameters
domDocument an XFA file as a DOM document
Returns
a System.Collections.IDictionary of XFA packet names and their associated DOM nodes

◆ FillXfaForm() [1/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( FileInfo  file )
inlinevirtual

Replaces the XFA data under datasets/data.

Replaces the XFA data under datasets/data. Accepts a file object to fill this object with XFA data. The resulting DOM document may be modified.

Parameters
file the System.IO.FileInfo

◆ FillXfaForm() [2/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( FileInfo  file,
bool  readOnly 
)
inlinevirtual

Replaces the XFA data under datasets/data.

Replaces the XFA data under datasets/data. Accepts a file object to fill this object with XFA data.

Parameters
file the System.IO.FileInfo
readOnly whether or not the resulting DOM document may be modified

◆ FillXfaForm() [3/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( Stream @  is )
inlinevirtual

Replaces the XFA data under datasets/data.

Replaces the XFA data under datasets/data. Accepts an System.IO.Stream to fill this object with XFA data. The resulting DOM document may be modified.

Parameters
is the System.IO.Stream

◆ FillXfaForm() [4/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( Stream @  is,
bool  readOnly 
)
inlinevirtual

Replaces the XFA data under datasets/data.

Replaces the XFA data under datasets/data. Accepts an System.IO.Stream to fill this object with XFA data.

Parameters
is the System.IO.Stream
readOnly whether or not the resulting DOM document may be modified

◆ FillXfaForm() [5/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( XmlReader @  is )
inlinevirtual

Replaces the XFA data under datasets/data.

Replaces the XFA data under datasets/data. Accepts an XML reader to fill this object with XFA data. The resulting DOM document may be modified.

Parameters
is the XML reader

◆ FillXfaForm() [6/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( XmlReader @  is,
bool  readOnly 
)
inlinevirtual

Replaces the XFA data under datasets/data.

Replaces the XFA data under datasets/data. Accepts an XML reader to fill this object with XFA data.

Parameters
is the XML reader
readOnly whether or not the resulting DOM document may be modified

◆ FillXfaForm() [7/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( XNode  node )
inlinevirtual

Replaces the XFA data under datasets/data.

Parameters
node the input System.Xml.Linq.XNode

◆ FillXfaForm() [8/8]

virtual void iText.Forms.Xfa.XfaForm.FillXfaForm ( XNode  node,
bool  readOnly 
)
inlinevirtual

Replaces the XFA data under datasets/data.

Parameters
node the input System.Xml.Linq.XNode
readOnly whether or not the resulting DOM document may be modified

◆ FindDatasetsName()

virtual String iText.Forms.Xfa.XfaForm.FindDatasetsName ( String  name )
inlinevirtual

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

Parameters
name the complete or partial name
Returns
the complete name or
null if not found

◆ FindDatasetsNode()

virtual XNode iText.Forms.Xfa.XfaForm.FindDatasetsNode ( String  name )
inlinevirtual

Finds the

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

Parameters
name the complete or partial name
Returns
the
Node or null if not found

◆ FindFieldName()

virtual String iText.Forms.Xfa.XfaForm.FindFieldName ( String  name )
inlinevirtual

Finds the complete field name from a partial name.

Parameters
name the complete or partial name
Returns
the complete name or
null if not found

◆ GetDatasetsNode()

virtual XElement iText.Forms.Xfa.XfaForm.GetDatasetsNode ( )
inlinevirtual

Gets the

Node that corresponds to the datasets part.

Returns
the
Node that corresponds to the datasets part

◆ GetDomDocument()

virtual XDocument iText.Forms.Xfa.XfaForm.GetDomDocument ( )
inlinevirtual

Gets the top level DOM document.

Returns
the top level DOM document

◆ GetNodeText()

static String iText.Forms.Xfa.XfaForm.GetNodeText ( XNode  n )
inlinestatic

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

Parameters
n the
Node
the text found or "" if no text was found

◆ GetNodeTextByPath()

virtual String iText.Forms.Xfa.XfaForm.GetNodeTextByPath ( String  path )
inlinevirtual

Gets all the text contained in the child nodes of the node under the provided path.

Parameters
path path to the node to extract text in the format "some.path.to.node"
Returns
text found under the provided path or null if node or text wasn't found

◆ GetXfaFieldValue()

virtual String iText.Forms.Xfa.XfaForm.GetXfaFieldValue ( String  name )
inlinevirtual

Gets the xfa field value.

Parameters
name the fully qualified field name
Returns
the field value

◆ IsXfaPresent()

virtual bool iText.Forms.Xfa.XfaForm.IsXfaPresent ( )
inlinevirtual

Returns

true if it is a XFA form.

Returns
true if it is a XFA form

◆ SetDomDocument()

virtual void iText.Forms.Xfa.XfaForm.SetDomDocument ( XDocument  domDocument )
inlinevirtual

Sets the top DOM document.

Parameters
domDocument the top DOM document

◆ SetNodeText()

virtual void iText.Forms.Xfa.XfaForm.SetNodeText ( XNode  n,
String  text 
)
inlinevirtual

Sets the text of this node.

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

Parameters
n the
Node to add the text to
"text">the text to add

◆ SetXfaFieldValue()

virtual void iText.Forms.Xfa.XfaForm.SetXfaFieldValue ( String  name,
String  value 
)
inlinevirtual

Changes a field value in the XFA form.

Parameters
name the name of the field to be changed
value the new value

◆ SetXfaForm() [1/2]

static void iText.Forms.Xfa.XfaForm.SetXfaForm ( XfaForm  form,
PdfAcroForm  acroForm 
)
inlinestatic

Sets the XFA key from a byte array.

Sets the XFA key from a byte array. The old XFA is erased.

Parameters
form the data
acroForm an AcroForm instance

◆ SetXfaForm() [2/2]

static void iText.Forms.Xfa.XfaForm.SetXfaForm ( XfaForm  form,
PdfDocument  pdfDocument 
)
inlinestatic

Sets the XFA key from a byte array.

Sets the XFA key from a byte array. The old XFA is erased.

Parameters
form the data
pdfDocument pdfDocument

◆ Write() [1/2]

virtual void iText.Forms.Xfa.XfaForm.Write ( PdfAcroForm  acroForm )
inlinevirtual

Write the XfaForm to the provided PdfDocument.

Parameters
acroForm the PdfAcroForm to write the XFA Form to

◆ Write() [2/2]

virtual void iText.Forms.Xfa.XfaForm.Write ( PdfDocument  document )
inlinevirtual

Write the XfaForm to the provided PdfDocument.

Parameters
document the PdfDocument to write the XFA Form to

Member Data Documentation

◆ XFA_DATA_SCHEMA

const String iText.Forms.Xfa.XfaForm.XFA_DATA_SCHEMA = "http://www.xfa.org/schema/xfa-data/1.0/"
static

The URI for the XFA Data schema.