Class PdfFillElement
- Namespace
- Syncfusion.Pdf.Graphics
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents an element to fill
public abstract class PdfFillElement : PdfDrawElement
- Inheritance
-
PdfFillElement
- 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(PdfBrushes.Red, 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(PdfBrushes.Red, 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
PdfFillElement()
Initializes a new instance of the PdfFillElement class.
protected PdfFillElement()
PdfFillElement(PdfBrush)
Initializes a new instance of the PdfFillElement class.
protected PdfFillElement(PdfBrush brush)
Parameters
brush
PdfBrushThe brush.
PdfFillElement(PdfPen)
Initializes a new instance of the PdfFillElement class.
protected PdfFillElement(PdfPen pen)
Parameters
pen
PdfPenThe pen.
PdfFillElement(PdfPen, PdfBrush)
Initializes a new instance of the PdfFillElement class.
protected PdfFillElement(PdfPen pen, PdfBrush brush)
Parameters
Properties
Brush
Gets or sets the brush of the element
public PdfBrush Brush { get; set; }
Property Value
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 PDF solid brush.
rect.Brush = new PdfSolidBrush(Color.Green);
//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 PDF solid brush.
rect.Brush = New PdfSolidBrush(Color.Green)
'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
ObtainPen()
Gets the pen. If both pen and brush are not explicitly defined, default pen will be used.
protected override PdfPen ObtainPen()
Returns
- PdfPen
brush