Class PdfXfaForm
- Namespace
- Syncfusion.Pdf.Xfa
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents interactive XFA form of the Pdf document.
public class PdfXfaForm : PdfXfaField, ICloneable
- Inheritance
-
PdfXfaForm
- Implements
- Inherited Members
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, float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(PdfXfaFlowDirection flowDirection, float width)
Parameters
flowDirection
PdfXfaFlowDirectionThe flow direction of the XFA form
width
floatThe 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, float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(PdfXfaPage xfaPage, PdfXfaFlowDirection flowDirection, float width)
Parameters
xfaPage
PdfXfaPageThe XFA page.
flowDirection
PdfXfaFlowDirectionThe flow direction of the XFA form
width
floatThe 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(float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(float width)
Parameters
width
floatThe 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, float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(string name, PdfXfaFlowDirection flowDirection, float width)
Parameters
name
stringThe name of the form.
flowDirection
PdfXfaFlowDirectionThe flow direction of the XFA form
width
floatThe 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, float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(string name, PdfXfaPage xfaPage, PdfXfaFlowDirection flowDirection, float width)
Parameters
name
stringThe name of the XFA form.
xfaPage
PdfXfaPageThe XFA page.
flowDirection
PdfXfaFlowDirectionThe flow direction of the XFA form.
width
floatThe 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, float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(string name, PdfXfaPage xfaPage, float width)
Parameters
name
stringThe name of the form.
xfaPage
PdfXfaPageThe page.
width
floatThe 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, float)
Initializes a new instance of the PdfXfaForm class.
public PdfXfaForm(string name, float width)
Parameters
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
public PdfXfaBorder Border { get; set; }
Property Value
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.
public PdfXfaFieldCollection Fields { get; }
Property Value
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
public PdfXfaFlowDirection FlowDirection { get; set; }
Property Value
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.
public PdfXfaPage Page { get; set; }
Property Value
ReadOnly
Gets or sets readonly
public bool ReadOnly { get; set; }
Property Value
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
public float Width { get; set; }
Property Value
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.
public object Clone()
Returns
- 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()