Class PdfXfaLine
- Namespace
- Syncfusion.Pdf.Xfa
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the line of the XFA form
public class PdfXfaLine : PdfXfaField
- Inheritance
-
PdfXfaLine
- 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 line and add the properties.
PdfXfaLine line = new PdfXfaLine(new PointF(0, 0), new PointF(200, 0), 3);
//Set the line color
line.Color = new PdfColor(Color.Red);
//Add the text line to the XFA form.
mainForm.Fields.Add(line);
//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 line and add the properties.
Dim line As New PdfXfaLine(New PointF(0,0),New PointF(200,0),3)
'Set the line color
line.Color = New PdfColor(Color.Red)
'Add the text line to the XFA form.
mainForm.Fields.Add(line)
'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
PdfXfaLine(PointF, PointF, float)
Initializes a new instance of the PdfXfaLine class.
public PdfXfaLine(PointF startLocation, PointF endLocation, float thickness)
Parameters
startLocation
PointFStart location of the Line.
endLocation
PointFEnd location of the Line.
thickness
floatThickness of the Line.
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 line and add the properties.
PdfXfaLine line = new PdfXfaLine(new PointF(0, 0), new PointF(200, 0), 3);
//Set the line color
line.Color = new PdfColor(Color.Red);
//Add the text line to the XFA form.
mainForm.Fields.Add(line);
//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 line and add the properties.
Dim line As New PdfXfaLine(New PointF(0,0),New PointF(200,0),3)
'Set the line color
line.Color = New PdfColor(Color.Red)
'Add the text line to the XFA form.
mainForm.Fields.Add(line)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Properties
Color
Gets or sets the line color
public PdfColor Color { get; set; }
Property Value
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 line and add the properties.
PdfXfaLine line = new PdfXfaLine(new PointF(0, 0), new PointF(200, 0), 3);
//Set the line color
line.Color = new PdfColor(Color.Red);
//Add the text line to the XFA form.
mainForm.Fields.Add(line);
//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 line and add the properties.
Dim line As New PdfXfaLine(New PointF(0,0),New PointF(200,0),3)
'Set the line color
line.Color = New PdfColor(Color.Red)
'Add the text line to the XFA form.
mainForm.Fields.Add(line)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Thickness
Gets or sets the thickness of the line
public float Thickness { get; set; }
Property Value
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 line and add the properties.
PdfXfaLine line = new PdfXfaLine(new PointF(0, 0), new PointF(200, 0), 3);
//Set the line color
line.Color = new PdfColor(Color.Red);
//Set thickness.
line.Thickness = 2;
//Add the text line to the XFA form.
mainForm.Fields.Add(line);
//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 line and add the properties.
Dim line As New PdfXfaLine(New PointF(0,0),New PointF(200,0),3)
'Set the line color
line.Color = New PdfColor(Color.Red)
'Set thickness
line.Thickness = 2
'Add the text line to the XFA form.
mainForm.Fields.Add(line)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()
Methods
Clone()
Creates a new object that is a copy of the current instance.
public object Clone()
Returns
- object
The copy of the new object for this instance.
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 line and add the properties.
PdfXfaLine line = new PdfXfaLine(new PointF(0, 0), new PointF(200, 0), 3);
//Set the line color
line.Color = new PdfColor(Color.Red);
//Add the text line to the XFA form.
mainForm.Fields.Add(line);
//Clone the line object.
mainForm.Fields.Add(line.Clone() as PdfXfaLine);
//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 line and add the properties.
Dim line As New PdfXfaLine(New PointF(0,0),New PointF(200,0),3)
'Set the line color
line.Color = New PdfColor(Color.Red)
'Add the text line to the XFA form.
mainForm.Fields.Add(line)
'Clone the line object.
mainForm.Fields.Add(TryCase(line.Clone(), PdfXfaLine))
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()