WPF

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

    Show / Hide Table of Contents

    Class PdfXfaLine

    Represents the line of the XFA form

    Inheritance
    System.Object
    PdfXfaField
    PdfXfaLine
    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 class PdfXfaLine : 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 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, Single)

    Initializes a new instance of the PdfXfaLine class.

    Declaration
    public PdfXfaLine(PointF startLocation, PointF endLocation, float thickness)
    Parameters
    Type Name Description
    System.Drawing.PointF startLocation

    Start location of the Line.

    System.Drawing.PointF endLocation

    End location of the Line.

    System.Single thickness

    Thickness 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

    Declaration
    public PdfColor Color { 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 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

    Declaration
    public float Thickness { 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 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.

    Declaration
    public object Clone()
    Returns
    Type Description
    System.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()
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved