Class PdfXfaField
Represents abstract class of the field in the XFA form.
Inheritance
System.Object
PdfXfaField
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public abstract class PdfXfaField
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()
Declaration
protected PdfXfaField()
Properties
Margins
Gets or sets the margins of the field.
Declaration
public PdfMargins Margins { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.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
Declaration
public PdfXfaVisibility Visibility { get; set; }
Property Value
Type | Description |
---|---|
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()