PdfXfaForm Class
Represents interactive XFA form of the Pdf document.
Implements
Inherited Members
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfXfaForm : PdfXfaField, ICloneable
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Constructors
PdfXfaForm(PdfXfaFlowDirection, Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(PdfXfaFlowDirection flowDirection, float width)
Parameters
Type | Name | Description |
---|---|---|
PdfXfaFlowDirection | flowDirection | The flow direction of the XFA form |
System.Single | width | The width of the XFA form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaForm(PdfXfaPage, PdfXfaFlowDirection, Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(PdfXfaPage xfaPage, PdfXfaFlowDirection flowDirection, float width)
Parameters
Type | Name | Description |
---|---|---|
PdfXfaPage | xfaPage | The XFA page. |
PdfXfaFlowDirection | flowDirection | The flow direction of the XFA form |
System.Single | width | The width of the form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA page.
PdfXfaPage page = document.Pages.Add();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(page, PdfXfaFlowDirection.Horizontal, 595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA page.
Dim page As PdfXfaPage = document.Pages.Add()
'Create a new XFA form
Dim form As New PdfXfaForm(page, PdfXfaFlowDirection.Horizontal, 595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaForm(Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(float width)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | The width fo the form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaForm(String, PdfXfaFlowDirection, Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(string name, PdfXfaFlowDirection flowDirection, float width)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the form. |
PdfXfaFlowDirection | flowDirection | The flow direction of the XFA form |
System.Single | width | The width of the form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm("form1", PdfXfaFlowDirection.Horizontal, 595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm("form1", PdfXfaFlowDirection.Horizontal, 595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaForm(String, PdfXfaPage, PdfXfaFlowDirection, Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(string name, PdfXfaPage xfaPage, PdfXfaFlowDirection flowDirection, float width)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the XFA form. |
PdfXfaPage | xfaPage | The XFA page. |
PdfXfaFlowDirection | flowDirection | The flow direction of the XFA form. |
System.Single | width | The width of the XFA form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA page.
PdfXfaPage page = document.Pages.Add();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm("form1", page, PdfXfaFlowDirection.Horizontal, 595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA page.
Dim page As PdfXfaPage = document.Pages.Add()
'Create a new XFA form
Dim form As New PdfXfaForm("form1", page, PdfXfaFlowDirection.Horizontal, 595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaForm(String, PdfXfaPage, Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(string name, PdfXfaPage xfaPage, float width)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the form. |
PdfXfaPage | xfaPage | The page. |
System.Single | width | The width of the form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA page.
PdfXfaPage page = document.Pages.Add();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm("form1", page, 595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA page.
Dim page As PdfXfaPage = document.Pages.Add()
'Create a new XFA form
Dim form As New PdfXfaForm("form1", page, 595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaForm(String, Single)
Initializes a new instance of the PdfXfaForm class.
Declaration
public PdfXfaForm(string name, float width)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the form. |
System.Single | width | The width of the form. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm("form1", 595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm("form1", 595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Properties
Border
Gets or sets the border
Declaration
public PdfXfaBorder Border { get; set; }
Property Value
Type |
---|
PdfXfaBorder |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set border.
form.Border = new PdfXfaBorder(Color.Red);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set border.
form.Border = New PdfXfaBorder(Color.Red)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Fields
Gets the fields.
Declaration
public PdfXfaFieldCollection Fields { get; }
Property Value
Type |
---|
PdfXfaFieldCollection |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
FlowDirection
Gets or sets the XFA flow direction
Declaration
public PdfXfaFlowDirection FlowDirection { get; set; }
Property Value
Type |
---|
PdfXfaFlowDirection |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Page
Gets or set the XFA Page.
Declaration
public PdfXfaPage Page { get; set; }
Property Value
Type |
---|
PdfXfaPage |
ReadOnly
Gets or sets readonly
Declaration
public bool ReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set readonly form.
form.ReadOnly = true;
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set readonly form.
form.ReadOnly = True
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Width
Gets or sets width of the form
Declaration
public float Width { get; set; }
Property Value
Type |
---|
System.Single |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set width.
form.Width = 565;
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set width.
form.Width = 565
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Methods
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | The copy of the new object for this instance. |
Examples
//Create a new XFA document
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(595);
//Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal;
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Add the field to the XFA form.
form.Fields.Add(field);
//Clone the form.
form.Fields.Add(form.Clone() as PdfXfaForm);
//Assign the form to document.
document.XfaForm = form;
//Save the document
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new XFA document
Dim document As New PdfXfaDocument()
'Create a new XFA form
Dim form As New PdfXfaForm(595)
'Set the flow direction.
form.FlowDirection = PdfXfaFlowDirection.Horizontal
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Add the field to the XFA form.
form.Fields.Add(field)
'Clone the form.
form.Fields.Add(TryCase(form.Clone(), PdfXfaForm));
'Assign the form to document.
document.XfaForm = form
'Save the document
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()