WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfXfaStyledField

    Show / Hide Table of Contents

    Class PdfXfaStyledField

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

    Inheritance
    System.Object
    PdfXfaField
    PdfXfaStyledField
    PdfXfaButtonField
    PdfXfaCheckBoxField
    PdfXfaComboBoxField
    PdfXfaDateTimeField
    PdfXfaListBoxField
    PdfXfaNumericField
    PdfXfaRadioButtonField
    PdfXfaTextBoxField
    Inherited Members
    PdfXfaField.Name
    PdfXfaField.Margins
    PdfXfaField.Visibility
    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 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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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()
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved