Class PdfRectangleArea
Represents an area bound by a rectangle.
Inheritance
Inherited Members
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.NET.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 |
---|
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 |
---|
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 |
---|
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 |
---|
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 |
---|
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 |
---|
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)