Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfRectangleArea

    Represents an area bound by a rectangle.

    Inheritance
    System.Object
    PdfGraphicsElement
    PdfLayoutElement
    PdfShapeElement
    PdfDrawElement
    PdfFillElement
    PdfRectangleArea
    PdfEllipse
    PdfEllipsePart
    PdfRectangle
    Inherited Members
    PdfFillElement.Brush
    PdfDrawElement.Pen
    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 PdfRectangleArea : PdfFillElement
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Draw the rectangle to PDF page.
    rect.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf") 
    Close the PDF document.
    document.Close(True)

    Constructors

    PdfRectangleArea()

    Initializes a new instance of the PdfRectangleArea class.

    Declaration
    protected PdfRectangleArea()

    PdfRectangleArea(RectangleF)

    Initializes a new instance of the PdfRectangleArea class.

    Declaration
    protected PdfRectangleArea(RectangleF rectangle)
    Parameters
    Type Name Description
    RectangleF rectangle

    The rectangle.

    PdfRectangleArea(PdfPen, PdfBrush, RectangleF)

    Initializes a new instance of the PdfRectangleArea class.

    Declaration
    protected PdfRectangleArea(PdfPen pen, PdfBrush brush, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen.

    PdfBrush brush

    The brush.

    RectangleF rectangle

    The rectangle.

    PdfRectangleArea(PdfPen, PdfBrush, Single, Single, Single, Single)

    Initializes a new instance of the PdfRectangleArea class.

    Declaration
    protected PdfRectangleArea(PdfPen pen, PdfBrush brush, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfPen pen

    The pen.

    PdfBrush brush

    The brush.

    System.Single x

    The x.

    System.Single y

    The y.

    System.Single width

    The width.

    System.Single height

    The height.

    PdfRectangleArea(Single, Single, Single, Single)

    Initializes a new instance of the PdfRectangleArea class.

    Declaration
    protected PdfRectangleArea(float x, float y, float width, float height)
    Parameters
    Type Name Description
    System.Single x

    The x.

    System.Single y

    The y.

    System.Single width

    The width.

    System.Single height

    The height.

    Properties

    Bounds

    Gets or sets bounds of this element.

    Declaration
    public RectangleF Bounds { get; set; }
    Property Value
    Type Description
    RectangleF
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Set the bounds of the element.
    rect.Bounds = new RectangleF(0, 10, 200, 100);
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Set the bounds of the element.
    rect.Bounds = New RectangleF(0, 10, 200, 100)
    'Draw the rectangle to PDF page.
    rect.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf") 
    Close the PDF document.
    document.Close(True)

    Height

    Gets or sets the height of this element.

    Declaration
    public float Height { get; set; }
    Property Value
    Type Description
    System.Single
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0;
    //Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0;
    //Set the width of the rectangle.
    rect.Width = 200;
    //Set the height of the rectangle.
    rect.Height = 100; 
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0
    'Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0
    'Set the width of the rectangle.
    rect.Width = 200
    'Set the height of the rectangle.
    rect.Height = 100 
    'Draw the rectangle to PDF page.
    rect.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf") 
    Close the PDF document.
    document.Close(True)

    Size

    Gets or sets the size of this element.

    Declaration
    public SizeF Size { get; set; }
    Property Value
    Type Description
    SizeF
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Set the size of the element.
    rect.Size = new SizeF(200, 100);
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Set the size of the element.
    rect.Size = New SizeF(200, 100)
    'Draw the rectangle to PDF page.
    rect.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf") 
    Close the PDF document.
    document.Close(True)

    Width

    Gets or sets the width of this element.

    Declaration
    public float Width { get; set; }
    Property Value
    Type Description
    System.Single
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0;
    //Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0;
    //Set the width of the rectangle.
    rect.Width = 200;
    //Set the height of the rectangle.
    rect.Height = 100; 
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0
    'Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0
    'Set the width of the rectangle.
    rect.Width = 200
    'Set the height of the rectangle.
    rect.Height = 100 
    'Draw the rectangle to PDF page.
    rect.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf") 
    Close the PDF document.
    document.Close(True)

    X

    Gets or sets the X co-ordinate of the upper-left corner of this the element.

    Declaration
    public float X { get; set; }
    Property Value
    Type Description
    System.Single
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0;
    //Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0;
    //Set the width of the rectangle.
    rect.Width = 200;
    //Set the height of the rectangle.
    rect.Height = 100; 
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0
    'Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0
    'Set the width of the rectangle.
    rect.Width = 200
    'Set the height of the rectangle.
    rect.Height = 100 
    'Draw the rectangle to PDF page.
    rect.Draw(page, PointF.Empty)
    'Save the PDF docment.
    document.Save("output.pdf") 
    Close the PDF document.
    document.Close(True)

    Y

    Gets or sets the Y co-ordinate of the upper-left corner of this the element.

    Declaration
    public float Y { get; set; }
    Property Value
    Type Description
    System.Single
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Add a new PDF page.
    PdfPage page = document.Pages.Add();
    //Create new PdfRectangle instance.
    PdfRectangle rect = new PdfRectangle(200, 100);
    //Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0;
    //Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0;
    //Set the width of the rectangle.
    rect.Width = 200;
    //Set the height of the rectangle.
    rect.Height = 100; 
    //Draw the rectangle to PDF page.
    rect.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 PdfRectangle instance.
    Dim rect As New PdfRectangle(200, 100)
    'Set the X co-ordinate of the upper-left corner of rectangle.
    rect.X = 0
    'Set the Y co-ordinate of the upper-left corner of rectangle.
    rect.Y = 0
    'Set the width of the rectangle.
    rect.Width = 200
    'Set the height of the rectangle.
    rect.Height = 100 
    'Draw the rectangle to PDF page.
    rect.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