Table of Contents

Class PdfXfaBorder

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

Represents the border of the XFA fields

public class PdfXfaBorder
Inheritance
PdfXfaBorder
Inherited Members

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set 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.

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.

public PdfXfaBorder(PdfColor color)

Parameters

color PdfColor

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

public PdfXfaEdge BottomEdge { get; set; }

Property Value

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

public PdfColor Color { get; set; }

Property Value

PdfColor

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set 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

public PdfXfaBrush FillColor { get; set; }

Property Value

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

public PdfXfaHandedness Handedness { get; set; }

Property Value

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

public PdfXfaEdge LeftEdge { get; set; }

Property Value

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

public PdfXfaEdge RightEdge { get; set; }

Property Value

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

public PdfXfaBorderStyle Style { get; set; }

Property Value

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

public PdfXfaEdge TopEdge { get; set; }

Property Value

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

public PdfXfaVisibility Visibility { get; set; }

Property Value

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

public float Width { get; set; }

Property Value

float

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a textbox field and add the properties.
PdfXfaTextBoxField textBoxField = new PdfXfaTextBoxField("FirstName", new SizeF(200, 20));
//Set 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()