Table of Contents

Class PdfXfaField

Namespace
Syncfusion.Pdf.Xfa
Assembly
Syncfusion.Pdf.Portable.dll

Represents abstract class of the field in the XFA form.

public abstract class PdfXfaField
Inheritance
PdfXfaField
Derived
Inherited Members

Examples

//Create a new XFA document 
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//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 form
form.Fields.Add(field);
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)
'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 form
form.Fields.Add(field)
document.XfaForm = form
'Save the document           
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()

Constructors

PdfXfaField()

protected PdfXfaField()

Properties

Margins

Gets or sets the margins of the field.

public PdfMargins Margins { get; set; }

Property Value

PdfMargins

Examples

//Create a new XFA document 
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
 //Set margin.
 field.Margins.All = 2;
//Add the field to the form
form.Fields.Add(field);
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)
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Set margin.
 field.Margins.All = 2
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document           
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()

Name

Gets or sets the name.

public string Name { get; set; }

Property Value

string

The name of the field.

Examples

//Create a new XFA document 
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Set field name.
field.Name = "firstName";
//Add the field to the form
form.Fields.Add(field);
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)
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Set field name.
field.Name = "firstName"
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document           
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()

Visibility

Gets or sets the visibility of the field

public PdfXfaVisibility Visibility { get; set; }

Property Value

PdfXfaVisibility

Examples

//Create a new XFA document 
PdfXfaDocument document = new PdfXfaDocument();
//Create a new XFA form
PdfXfaForm form = new PdfXfaForm(PdfXfaFlowDirection.Horizontal, 595);
//Create a new XFA Field
PdfXfaTextBoxField field = new PdfXfaTextBoxField("textBox1", new SizeF(200, 30));
//Set text.
field.Text = "Text Box Field.";
//Set fields visibility.
field.Visibility = PdfXfaVisibility.Visible;
//Add the field to the form
form.Fields.Add(field);
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)
'Create a new XFA Field
Dim field As New PdfXfaTextBoxField("textBox1", New SizeF(200, 30))
'Set text.
field.Text = "Text Box Field."
'Set fields visibility.
field.Visibility = PdfXfaVisibility.Visible
'Add the field to the form
form.Fields.Add(field)
document.XfaForm = form
'Save the document           
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()