Table of Contents

Class PdfXfaStyledField

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

Represents the abstract calss of the XFA form field's style parameters.

public abstract class PdfXfaStyledField : PdfXfaField
Inheritance
PdfXfaStyledField
Derived
Inherited Members

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

Constructors

PdfXfaStyledField()

protected PdfXfaStyledField()

Properties

Border

Gets or sets the Border

public PdfXfaBorder Border { get; set; }

Property Value

PdfXfaBorder

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

Font

Gets or sets the font

public PdfFont Font { get; set; }

Property Value

PdfFont

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

ForeColor

Gets or sets the fore color of the field

public PdfColor ForeColor { get; set; }

Property Value

PdfColor

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

Height

Gets or sets height of the field

public float Height { get; set; }

Property Value

float

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

HorizontalAlignment

Gets or sets the horizontal alignment of the field

public PdfXfaHorizontalAlignment HorizontalAlignment { get; set; }

Property Value

PdfXfaHorizontalAlignment

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

ReadOnly

Gets or sets the readonly

public bool ReadOnly { get; set; }

Property Value

bool

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set readonly.
textBoxField.ReadOnly = true;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set readonly.
textBoxField.ReadOnly = True
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

Rotate

Gets or sets the rotation angle

public PdfXfaRotateAngle Rotate { get; set; }

Property Value

PdfXfaRotateAngle

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

ToolTip

Gets or sets the tool tip

public string ToolTip { get; set; }

Property Value

string

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

VerticalAlignment

Gets or sets the vertical alignment of the field

public PdfXfaVerticalAlignment VerticalAlignment { get; set; }

Property Value

PdfXfaVerticalAlignment

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()

Width

Gets or sets width of the field

public float Width { get; set; }

Property Value

float

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set the caption text.
textBoxField.Caption.Text = "First Name";
//Set fields width and height.
textBoxField.Width = 200;
textBoxField.Height = 30;
//Set border.
textBoxField.Border.Color = Color.Red;
//Set font.
textBoxField.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//Set fore color.
textBoxField.ForeColor = Color.Yellow;
//Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90;
//Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center;
//Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle;
//Set the tool tip.
textBoxField.ToolTip = "First Name";
//Add the field to the XFA form.
mainForm.Fields.Add(textBoxField);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a textbox field and add the properties.
Dim textBoxField As New PdfXfaTextBoxField("FirstName", New SizeF(200, 20))
'Set the caption text.
textBoxField.Caption.Text = "First Name"
'Set fields width and height.
textBoxField.Width = 200
textBoxField.Height = 30
'Set border.
textBoxField.Border.Color = Color.Red
'Set font.
textBoxField.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
'Set fore color.
textBoxField.ForeColor = Color.Yellow
'Set rotation angle.
textBoxField.Rotate = PdfXfaRotateAngle.RotateAngle90
'Set horizontal alignment.
textBoxField.HorizontalAlignment = PdfXfaHorizontalAlignment.Center
'Set vertical alignment.
textBoxField.VerticalAlignment = PdfXfaVerticalAlignment.Middle
'Set the tool tip.
textBoxField.ToolTip = "First Name"
'Add the field to the XFA form.
mainForm.Fields.Add(textBoxField)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic)
'close the document
document.Close()