Class PdfShapeElement
Base class for the main shapes.
Inheritance
System.Object
PdfShapeElement
Inherited Members
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public abstract class PdfShapeElement : PdfLayoutElement
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
PdfShapeElement()
Declaration
protected PdfShapeElement()
Methods
GetBounds()
Gets the bounds.
Declaration
public RectangleF GetBounds()
Returns
Type | Description |
---|---|
RectangleF | rect |
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);
//Get the bounds.
RectangleF bounds = rect.GetBounds();
//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)
'Get the bounds.
Dim bounds As RectangleF = rect.GetBounds()
'Save the PDF docment.
document.Save("output.pdf")
Close the PDF document.
document.Close(True)
Layout(PdfLayoutParams)
Layouts the element.
Declaration
protected override PdfLayoutResult Layout(PdfLayoutParams param)
Parameters
Type | Name | Description |
---|---|---|
PdfLayoutParams | param | Lay outing parameters. |
Returns
Type | Description |
---|---|
PdfLayoutResult | Returns lay outing results. |