Class PdfXfaStyledField
Represents the abstract calss of the XFA form field's style parameters.
Inheritance
System.Object
PdfXfaStyledField
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public abstract class PdfXfaStyledField : PdfXfaField
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()
Declaration
protected PdfXfaStyledField()
Properties
Border
Gets or sets the Border
Declaration
public PdfXfaBorder Border { get; set; }
Property Value
Type |
---|
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
Declaration
public PdfFont Font { get; set; }
Property Value
Type |
---|
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
Declaration
public PdfColor ForeColor { get; set; }
Property Value
Type |
---|
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
Declaration
public float Height { get; set; }
Property Value
Type |
---|
System.Single |
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
Declaration
public PdfXfaHorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type |
---|
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
Declaration
public bool ReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
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
Declaration
public PdfXfaRotateAngle Rotate { get; set; }
Property Value
Type |
---|
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
Declaration
public string ToolTip { get; set; }
Property Value
Type |
---|
System.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
Declaration
public PdfXfaVerticalAlignment VerticalAlignment { get; set; }
Property Value
Type |
---|
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
Declaration
public float Width { get; set; }
Property Value
Type |
---|
System.Single |
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()