menu

Document Processing

PdfXfaBorder Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfXfaBorder Class

    Represents the border of the XFA fields

    Inheritance
    System.Object
    PdfXfaBorder
    Namespace: Syncfusion.Pdf.Xfa
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfXfaBorder : Object
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder();
    border.Color = Color.Red;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder()
    border.Color = Color.Red
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Constructors

    PdfXfaBorder()

    Initialize the instance of PdfXfaBorder class.

    Declaration
    public 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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder();
    border.Color = Color.Red;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder()
    border.Color = Color.Red
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    PdfXfaBorder(PdfColor)

    Initialize the instance of PdfXfaBorder class.

    Declaration
    public PdfXfaBorder(PdfColor color)
    Parameters
    Type Name Description
    PdfColor color

    Border color.

    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);      
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)      
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Properties

    BottomEdge

    Gets or sets the bottom edge

    Declaration
    public PdfXfaEdge BottomEdge { get; set; }
    Property Value
    Type
    PdfXfaEdge
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Create new PDF XFA edge instance.
    PdfXfaEdge edge = new PdfXfaEdge();
    //Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered;
    //Set edge color.
    edge.Color = Color.HotPink;
    //Set edge thickness.
    edge.Thickness = 2;
    //Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible;
    //Set the edge to XFA border.
    border.BottomEdge = edge;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Create new PDF XFA edge instance.
    Dim edge As New PdfXfaEdge()
    'Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered
    'Set edge color.
    edge.Color = Color.HotPink
    'Set edge thickness.
    edge.Thickness = 2
    'Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible
    'Set the edge to XFA border.
    border.BottomEdge = edge
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Color

    Gets or sets the border color

    Declaration
    public PdfColor Color { 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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder();
    border.Color = Color.Red;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder()
    border.Color = Color.Red
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    FillColor

    Gets or sets the fill color of the border

    Declaration
    public PdfXfaBrush FillColor { get; set; }
    Property Value
    Type
    PdfXfaBrush
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Set border fill color.
    border.FillColor = new PdfXfaSolidBrush(Color.Green);
    //Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right;
    //Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised;
    //Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible;
    //Set the border with.
    border.Width = 2;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Set border fill color.
    border.FillColor = New PdfXfaSolidBrush(Color.Green)
    'Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right
    'Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised
    'Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible
    'Set the border with.
    border.Width = 2
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Handedness

    Gets or sets handedness of a line or edge

    Declaration
    public PdfXfaHandedness Handedness { get; set; }
    Property Value
    Type
    PdfXfaHandedness
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Set border fill color.
    border.FillColor = new PdfXfaSolidBrush(Color.Green);
    //Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right;
    //Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised;
    //Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible;
    //Set the border with.
    border.Width = 2;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Set border fill color.
    border.FillColor = New PdfXfaSolidBrush(Color.Green)
    'Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right
    'Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised
    'Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible
    'Set the border with.
    border.Width = 2
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    LeftEdge

    Gets or sets the left edge

    Declaration
    public PdfXfaEdge LeftEdge { get; set; }
    Property Value
    Type
    PdfXfaEdge
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Create new PDF XFA edge instance.
    PdfXfaEdge edge = new PdfXfaEdge();
    //Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered;
    //Set edge color.
    edge.Color = Color.HotPink;
    //Set edge thickness.
    edge.Thickness = 2;
    //Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible;
    //Set the edge to XFA border.
    border.LeftEdge = edge;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Create new PDF XFA edge instance.
    Dim edge As New PdfXfaEdge()
    'Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered
    'Set edge color.
    edge.Color = Color.HotPink
    'Set edge thickness.
    edge.Thickness = 2
    'Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible
    'Set the edge to XFA border.
    border.LeftEdge = edge
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    RightEdge

    Gets or sets the right edge

    Declaration
    public PdfXfaEdge RightEdge { get; set; }
    Property Value
    Type
    PdfXfaEdge
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Create new PDF XFA edge instance.
    PdfXfaEdge edge = new PdfXfaEdge();
    //Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered;
    //Set edge color.
    edge.Color = Color.HotPink;
    //Set edge thickness.
    edge.Thickness = 2;
    //Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible;
    //Set the edge to XFA border.
    border.RightEdge = edge;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Create new PDF XFA edge instance.
    Dim edge As New PdfXfaEdge()
    'Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered
    'Set edge color.
    edge.Color = Color.HotPink
    'Set edge thickness.
    edge.Thickness = 2
    'Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible
    'Set the edge to XFA border.
    border.RightEdge = edge
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Style

    Gets or sets the border style

    Declaration
    public PdfXfaBorderStyle Style { get; set; }
    Property Value
    Type
    PdfXfaBorderStyle
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Set border fill color.
    border.FillColor = new PdfXfaSolidBrush(Color.Green);
    //Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right;
    //Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised;
    //Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible;
    //Set the border with.
    border.Width = 2;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Set border fill color.
    border.FillColor = New PdfXfaSolidBrush(Color.Green)
    'Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right
    'Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised
    'Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible
    'Set the border with.
    border.Width = 2
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    TopEdge

    Gets or sets the top edge

    Declaration
    public PdfXfaEdge TopEdge { get; set; }
    Property Value
    Type
    PdfXfaEdge
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Create new PDF XFA edge instance.
    PdfXfaEdge edge = new PdfXfaEdge();
    //Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered;
    //Set edge color.
    edge.Color = Color.HotPink;
    //Set edge thickness.
    edge.Thickness = 2;
    //Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible;
    //Set the edge to XFA border.
    border.TopEdge = edge;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Create new PDF XFA edge instance.
    Dim edge As New PdfXfaEdge()
    'Set edge border style.
    edge.BorderStyle = PdfXfaBorderStyle.Lowered
    'Set edge color.
    edge.Color = Color.HotPink
    'Set edge thickness.
    edge.Thickness = 2
    'Set edge visibility.
    edge.Visibility = PdfXfaVisibility.Visible
    'Set the edge to XFA border.
    border.TopEdge = edge
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Visibility

    Gets or sets the visibility of the border

    Declaration
    public PdfXfaVisibility Visibility { get; set; }
    Property Value
    Type
    PdfXfaVisibility
    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Set border fill color.
    border.FillColor = new PdfXfaSolidBrush(Color.Green);
    //Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right;
    //Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised;
    //Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible;
    //Set the border with.
    border.Width = 2;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Set border fill color.
    border.FillColor = New PdfXfaSolidBrush(Color.Green)
    'Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right
    'Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised
    'Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible
    'Set the border with.
    border.Width = 2
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()

    Width

    Gets or sets the border width

    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 caption text.
    textBoxField.Caption.Text = "First Name";
    //Create new PDF XFA border instance.
    PdfXfaBorder border = new PdfXfaBorder(Color.Red);
    //Set border fill color.
    border.FillColor = new PdfXfaSolidBrush(Color.Green);
    //Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right;
    //Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised;
    //Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible;
    //Set the border with.
    border.Width = 2;
    //Set border to text box field.
    textBoxField.Border = border;
    //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("output.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 caption text.
    textBoxField.Caption.Text = "First Name"
    'Create new PDF XFA border instance.
    Dim border As New PdfXfaBorder(Color.Red)
    'Set border fill color.
    border.FillColor = New PdfXfaSolidBrush(Color.Green)
    'Set handedness of the border.
    border.Handedness = PdfXfaHandedness.Right
    'Set the style of the border.
    border.Style = PdfXfaBorderStyle.Raised
    'Set the border visibility.
    border.Visibility = PdfXfaVisibility.Visible
    'Set the border with.
    border.Width = 2
    'Set border to text box field.
    textBoxField.Border = border
    '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("output.pdf", PdfXfaType.Dynamic)
    'close the document
    document.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved