Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfDrawElement

    Represents a graphics element which can be drawn by a pen.

    Inheritance
    System.Object
    PdfGraphicsElement
    PdfLayoutElement
    PdfShapeElement
    PdfDrawElement
    PdfBezierCurve
    PdfFillElement
    PdfLine
    Inherited Members
    PdfShapeElement.GetBounds()
    PdfShapeElement.Layout(PdfLayoutParams)
    PdfLayoutElement.add_EndPageLayout(EndPageLayoutEventHandler)
    PdfLayoutElement.remove_EndPageLayout(EndPageLayoutEventHandler)
    PdfLayoutElement.add_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.remove_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.Draw(PdfPage, PointF)
    PdfLayoutElement.Draw(PdfPage, Single, Single)
    PdfLayoutElement.Draw(PdfPage, RectangleF)
    PdfLayoutElement.Draw(PdfPage, PointF, PdfLayoutFormat)
    PdfLayoutElement.Draw(PdfPage, Single, Single, PdfLayoutFormat)
    PdfLayoutElement.Draw(PdfPage, RectangleF, PdfLayoutFormat)
    PdfLayoutElement.Layout(HtmlToPdfLayoutParams)
    PdfLayoutElement.PdfTag
    PdfLayoutElement.EndPageLayout
    PdfLayoutElement.BeginPageLayout
    PdfGraphicsElement.Draw(PdfGraphics)
    PdfGraphicsElement.Draw(PdfGraphics, PointF)
    PdfGraphicsElement.Draw(PdfGraphics, Single, Single)
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public abstract class PdfDrawElement : PdfShapeElement
    Examples
     //Create a new PDF document.
     PdfDocument document = new PdfDocument();
     //Add a new PDF page.
     PdfPage page = document.Pages.Add();
     //Create new PDF pen.
     PdfPen pen = new PdfPen(Color.Red);
     //Create new PdfLine instance.
     PdfLine line = new PdfLine(pen, new PointF(0, 0), new PointF(100, 0));
     //Draw the line to PDF page.
     line.Draw(page, PointF.Empty);
     //Save the PDF docment.
     document.Save("output.pdf");
     //Close the PDF document.
     document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Add a new PDF page.
    Dim page As PdfPage = document.Pages.Add()
    'Create new PDF pen.
    Dim pen As New PdfPen(Color.Red)
    'Create new PdfLine instance.
    Dim line As New PdfLine(pen, New PointF(0, 0), New PointF(100, 0))
    'Draw the line to PDF page.
    line.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf")
    'Close the PDF document.
    document.Close(True)

    Constructors

    PdfDrawElement()

    Initializes a new instance of the PdfDrawElement class.

    Declaration
    protected PdfDrawElement()

    PdfDrawElement(PdfPen)

    Initializes a new instance of the PdfDrawElement class with the specified pen

    Declaration
    protected PdfDrawElement(PdfPen pen)
    Parameters
    Type Name Description
    PdfPen pen

    The pen.

    Properties

    Pen

    Gets or sets a pen that will be used to draw the element.

    Declaration
    public PdfPen Pen { get; set; }
    Property Value
    Type Description
    PdfPen
    Examples
     //Create a new PDF document.
     PdfDocument document = new PdfDocument();
     //Add a new PDF page.
     PdfPage page = document.Pages.Add();
     //Create new PdfLine instance.
     PdfLine line = new PdfLine(new PointF(0, 0), new PointF(100, 0));
     //Set pen.
     line.Pen = new PdfPen(Color.Red);
     //Draw the line to PDF page.
     line.Draw(page, PointF.Empty);
     //Save the PDF docment.
     document.Save("output.pdf");
     //Close the PDF document.
     document.Close(true);
    'Create a new PDF document.
    Dim document As New PdfDocument()
    'Add a new PDF page.
    Dim page As PdfPage = document.Pages.Add()
    'Create new PdfLine instance.
    Dim line As New PdfLine(New PointF(0, 0), New PointF(100, 0))
    'Set pen.
    line.Pen = New PdfPen(Color.Red)
    'Draw the line to PDF page.
    line.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf")
    'Close the PDF document.
    document.Close(True)
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved