Table of Contents

Class PdfRectangleArea

Namespace
Syncfusion.Pdf.Graphics
Assembly
Syncfusion.Pdf.Portable.dll

Represents an area bound by a rectangle.

public abstract class PdfRectangleArea : PdfFillElement
Inheritance
PdfRectangleArea
Derived
Inherited Members

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.

protected PdfRectangleArea()

PdfRectangleArea(RectangleF)

Initializes a new instance of the PdfRectangleArea class.

protected PdfRectangleArea(RectangleF rectangle)

Parameters

rectangle RectangleF

The rectangle.

PdfRectangleArea(PdfPen, PdfBrush, RectangleF)

Initializes a new instance of the PdfRectangleArea class.

protected PdfRectangleArea(PdfPen pen, PdfBrush brush, RectangleF rectangle)

Parameters

pen PdfPen

The pen.

brush PdfBrush

The brush.

rectangle RectangleF

The rectangle.

PdfRectangleArea(PdfPen, PdfBrush, float, float, float, float)

Initializes a new instance of the PdfRectangleArea class.

protected PdfRectangleArea(PdfPen pen, PdfBrush brush, float x, float y, float width, float height)

Parameters

pen PdfPen

The pen.

brush PdfBrush

The brush.

x float

The x.

y float

The y.

width float

The width.

height float

The height.

PdfRectangleArea(float, float, float, float)

Initializes a new instance of the PdfRectangleArea class.

protected PdfRectangleArea(float x, float y, float width, float height)

Parameters

x float

The x.

y float

The y.

width float

The width.

height float

The height.

Properties

Bounds

Gets or sets bounds of this element.

public RectangleF Bounds { get; set; }

Property Value

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.

public float Height { get; set; }

Property Value

float

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.

public SizeF Size { get; set; }

Property Value

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.

public float Width { get; set; }

Property Value

float

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.

public float X { get; set; }

Property Value

float

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.

public float Y { get; set; }

Property Value

float

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)

Methods

GetBoundsInternal()

Overloaded. Returns a rectangle that bounds this element.

protected override RectangleF GetBoundsInternal()

Returns

RectangleF

Returns a rectangle that bounds this element.