menu

Document Processing

PdfPie Class - C# PDF Library API Reference | Syncfusion

    Show / Hide Table of Contents

    PdfPie Class

    Represents a pie shape.

    Inheritance
    System.Object
    PdfGraphicsElement
    PdfLayoutElement
    PdfShapeElement
    PdfDrawElement
    PdfFillElement
    PdfRectangleArea
    PdfEllipsePart
    PdfPie
    Inherited Members
    PdfDrawElement.Pen
    PdfEllipsePart.StartAngle
    PdfEllipsePart.SweepAngle
    PdfFillElement.Brush
    PdfGraphicsElement.Draw(PdfGraphics)
    PdfGraphicsElement.Draw(PdfGraphics, PointF)
    PdfGraphicsElement.Draw(PdfGraphics, Single, Single)
    PdfLayoutElement.add_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.add_EndPageLayout(EndPageLayoutEventHandler)
    PdfLayoutElement.BeginPageLayout
    PdfLayoutElement.Draw(PdfPage, PointF)
    PdfLayoutElement.Draw(PdfPage, PointF, PdfLayoutFormat)
    PdfLayoutElement.Draw(PdfPage, RectangleF)
    PdfLayoutElement.Draw(PdfPage, RectangleF, PdfLayoutFormat)
    PdfLayoutElement.Draw(PdfPage, Single, Single)
    PdfLayoutElement.Draw(PdfPage, Single, Single, PdfLayoutFormat)
    PdfLayoutElement.EndPageLayout
    PdfLayoutElement.Layout(HtmlToPdfLayoutParams)
    PdfLayoutElement.PdfTag
    PdfLayoutElement.remove_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.remove_EndPageLayout(EndPageLayoutEventHandler)
    PdfRectangleArea.Bounds
    PdfRectangleArea.Height
    PdfRectangleArea.Size
    PdfRectangleArea.Width
    PdfRectangleArea.X
    PdfRectangleArea.Y
    PdfShapeElement.GetBounds()
    PdfShapeElement.Layout(PdfLayoutParams)
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfPie : PdfEllipsePart
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(new RectangleF(0, 0, 200, 100), 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(New RectangleF(0, 0, 200, 100), 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Constructors

    PdfPie()

    Initializes a new instance of the PdfPie class.

    Declaration
    protected PdfPie()

    PdfPie(PdfBrush, RectangleF, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfBrush brush, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfBrush brush

    The brush of the pie shape.

    System.Drawing.RectangleF rectangle

    The rectangle region of the pie shape.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfBrushes.Red, new RectangleF(0, 0, 200, 100), 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfBrushes.Red, New RectangleF(0, 0, 200, 100), 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfBrush, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfBrush brush, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfBrush brush

    The brush of the pie shape.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfBrushes.Red, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfBrushes.Red, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfBrush, Single, Single, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfBrush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfBrush brush

    The brush of the pie shape.

    System.Single x

    The x-coordinate of the upper-left corner of the bounding rectangle.

    System.Single y

    The y-coordinate of the upper-left corner of the bounding rectangle.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfBrushes.Red, 0, 0, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfBrushes.Red, 0, 0, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfPen, PdfBrush, RectangleF, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfPen pen, PdfBrush brush, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen of the pie shape.

    PdfBrush brush

    The brush of the pie shape.

    System.Drawing.RectangleF rectangle

    The rectangle region of the pie shape.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfPens.Black, PdfBrushes.Red, new RectangleF(0, 0, 200, 100), 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfPens.Black, PdfBrushes.Red, New RectangleF(0, 0, 200, 100), 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfPen, PdfBrush, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfPen pen, PdfBrush brush, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen of the pie shape.

    PdfBrush brush

    The brush of the pie shape.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfPens.Black, PdfBrushes.Red, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfPens.Black, PdfBrushes.Red, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfPen, PdfBrush, Single, Single, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfPen pen, PdfBrush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen of the pie shape.

    PdfBrush brush

    The brush of the pie shape.

    System.Single x

    The x-coordinate of the upper-left corner of the bounding rectangle.

    System.Single y

    The y-coordinate of the upper-left corner of the bounding rectangle.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfPens.Black, PdfBrushes.Red, 0, 0, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfPens.Black, PdfBrushes.Red, 0, 0, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfPen, RectangleF, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfPen pen, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen of the pie.

    System.Drawing.RectangleF rectangle

    The rectangle region of the pie shape.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfPens.Red, new RectangleF(0, 0, 200, 100), 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfPens.Red,New RectangleF(0, 0, 200, 100), 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfPen, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfPen pen, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen of the pie shape.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfPens.Red, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfPens.Red, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(PdfPen, Single, Single, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(PdfPen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen

    The pen of the pie shape.

    System.Single x

    The x-coordinate of the upper-left corner of the bounding rectangle.

    System.Single y

    The y-coordinate of the upper-left corner of the bounding rectangle.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(PdfPens.Red, 0, 0, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(PdfPens.Red, 0, 0, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(RectangleF, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    System.Drawing.RectangleF rectangle

    The rectangle region of the pie shape.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(new RectangleF(0, 0, 200, 100), 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(New RectangleF(0, 0, 200, 100), 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    PdfPie(Single, Single, Single, Single, Single, Single)

    Initializes a new instance of the PdfPie class.

    Declaration
    public PdfPie(float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    System.Single x

    The x-coordinate of the upper-left corner of the bounding rectangle.

    System.Single y

    The y-coordinate of the upper-left corner of the bounding rectangle.

    System.Single width

    The width of the bounding rectangle.

    System.Single height

    The height of the bounding rectangle.

    System.Single startAngle

    Angle in degrees measured clockwise from the x-axis to the starting point of the pie.

    System.Single sweepAngle

    Angle in degrees measured clockwise from the startAngle parameter to ending point of the pie.

    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create a new PDF pie instance.
    PdfPie pie = new PdfPie(0, 0, 200, 100, 0, 180);
    //Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty);
    //Save the document.
    doc.Save("Output.pdf");
    //Close the document.
    doc.Close(true);
    'Create a new PDF document.
    Dim doc As New PdfDocument()
    'Add a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Create a new PDF pie instance.
    Dim pie As New PdfPie(0, 0, 200, 100, 0, 180)
    'Draw the pie to PDF page.
    pie.Draw(page, PointF.Empty)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)
    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »