Xamarin.iOS

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfGraphics

    Show / Hide Table of Contents

    Class PdfGraphics

    Represents a graphics context of the objects. It's used for performing all the graphics operations.

    Inheritance
    System.Object
    PdfGraphics
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfGraphics : Object
    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Draw string to PDF page graphics.
    graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty);
    //Draw the rectangle to PDF page graphics.
    graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 20, 200, 100));
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Draw string to PDF page graphics.
    graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty)
    'Draw the rectangle to PDF page graphics.
    graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 20, 200, 100))
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Properties

    ClientSize

    Gets the size of the canvas reduced by margins and page templates.

    Declaration
    public SizeF ClientSize { get; }
    Property Value
    Type Description
    SizeF
    Remarks

    It indicates a size of the canvas reduced by margins and template dimensions. This value doesn't change when any custom clip is set.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Get the graphics client size.
    SizeF clientSize = graphics.ClientSize;
    //Draw rectangle to PDF graphics.
    graphics.DrawRectangle(PdfBrushes.Red, new RectangleF(PointF.Empty, clientSize));
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Get the graphics client size.
    Dim clientSize As SizeF = graphics.ClientSize
    'Draw rectangle to PDF graphics.
    graphics.DrawRectangle(PdfBrushes.Red, New RectangleF(PointF.Empty, clientSize))
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    ColorSpace

    Gets or sets the current color space of the document

    Declaration
    public PdfColorSpace ColorSpace { get; set; }
    Property Value
    Type Description
    PdfColorSpace
    Remarks

    The value change of this property has impact on the objects which will be drawn after the change.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Set the color space.
    graphics.ColorSpace = PdfColorSpace.GrayScale;
    //Get the graphics client size.
    SizeF clientSize = graphics.ClientSize;
    //Draw rectangle to PDF graphics.
    graphics.DrawRectangle(PdfBrushes.Red, new RectangleF(PointF.Empty, clientSize));
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Set the color space.
    graphics.ColorSpace = PdfColorSpace.GrayScale
    'Get the graphics client size.
    Dim clientSize As SizeF = graphics.ClientSize
    'Draw rectangle to PDF graphics.
    graphics.DrawRectangle(PdfBrushes.Red, New RectangleF(PointF.Empty, clientSize))
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Size

    Gets the size of the canvas.

    Declaration
    public SizeF Size { get; }
    Property Value
    Type Description
    SizeF
    Remarks

    Usually, this value is equal to the size of the object this graphics belongs to.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Get the graphics canvas size.
    SizeF canvasSize = graphics.Size;
    //Draw string to PDF page graphics.
    graphics.DrawString("Canvas size: " + canvasSize.ToString(), font, PdfBrushes.Black, PointF.Empty);
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Get the graphics canvas size.
    Dim canvasSize As SizeF = graphics.Size
    'Draw string to PDF page graphics.
    graphics.DrawString("Canvas size: " + canvasSize.ToString(), font, PdfBrushes.Black, PointF.Empty)
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Methods

    DrawArc(PdfPen, RectangleF, Single, Single)

    Declaration
    public void DrawArc(PdfPen pen, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen
    RectangleF rectangle
    System.Single startAngle
    System.Single sweepAngle

    DrawArc(PdfPen, Single, Single, Single, Single, Single, Single)

    Declaration
    public void DrawArc(PdfPen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen
    System.Single x
    System.Single y
    System.Single width
    System.Single height
    System.Single startAngle
    System.Single sweepAngle

    DrawBezier(PdfPen, PointF, PointF, PointF, PointF)

    Declaration
    public void DrawBezier(PdfPen pen, PointF startPoint, PointF firstControlPoint, PointF secondControlPoint, PointF endPoint)
    Parameters
    Type Name Description
    PdfPen pen
    PointF startPoint
    PointF firstControlPoint
    PointF secondControlPoint
    PointF endPoint

    DrawBezier(PdfPen, Single, Single, Single, Single, Single, Single, Single, Single)

    Declaration
    public void DrawBezier(PdfPen pen, float startPointX, float startPointY, float firstControlPointX, float firstControlPointY, float secondControlPointX, float secondControlPointY, float endPointX, float endPointY)
    Parameters
    Type Name Description
    PdfPen pen
    System.Single startPointX
    System.Single startPointY
    System.Single firstControlPointX
    System.Single firstControlPointY
    System.Single secondControlPointX
    System.Single secondControlPointY
    System.Single endPointX
    System.Single endPointY

    DrawEllipse(PdfBrush, RectangleF)

    Declaration
    public void DrawEllipse(PdfBrush brush, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfBrush brush
    RectangleF rectangle

    DrawEllipse(PdfBrush, Single, Single, Single, Single)

    Declaration
    public void DrawEllipse(PdfBrush brush, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfBrush brush
    System.Single x
    System.Single y
    System.Single width
    System.Single height

    DrawEllipse(PdfPen, RectangleF)

    Declaration
    public void DrawEllipse(PdfPen pen, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfPen pen
    RectangleF rectangle

    DrawEllipse(PdfPen, PdfBrush, RectangleF)

    Declaration
    public void DrawEllipse(PdfPen pen, PdfBrush brush, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    RectangleF rectangle

    DrawEllipse(PdfPen, PdfBrush, Single, Single, Single, Single)

    Declaration
    public void DrawEllipse(PdfPen pen, PdfBrush brush, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    System.Single x
    System.Single y
    System.Single width
    System.Single height

    DrawEllipse(PdfPen, Single, Single, Single, Single)

    Declaration
    public void DrawEllipse(PdfPen pen, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfPen pen
    System.Single x
    System.Single y
    System.Single width
    System.Single height

    DrawImage(PdfImage, PointF)

    Draws the specified PdfImage, using its original physical size, at the specified location..

    Declaration
    public void DrawImage(PdfImage image, PointF point)
    Parameters
    Type Name Description
    PdfImage image

    PdfImage to draw.

    PointF point

    Point structure that represents the location of the upper-left corner of the drawn image.

    Examples
    //Creates a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Adds a page to the document.
    PdfPage page = doc.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics g = page.Graphics;
    //Creates an image object.
    PdfBitmap image = new PdfBitmap("Autumn Leaves.jpg");
    //Draws the image.
    g.DrawImage(image, new PointF(0, 0));
    //Saves the document.
    doc.Save("Output.pdf");
    //Closes the document.
    doc.Close(true);
    'Creates a new PDF document.
    Dim doc As New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Creates PDF graphics for the page.
    Dim g As PdfGraphics = page.Graphics
    'Creates an image object.
    Dim image As New PdfBitmap("Autumn Leaves.jpg")
    'Draws the image.
    g.DrawImage(image,New PointF(0, 0))
    'Saves the document.
    doc.Save("Output.pdf")
    'Closes the document.
    doc.Close()

    DrawImage(PdfImage, PointF, SizeF)

    Draws the specified Image at the specified location and with the specified shape and size.

    Declaration
    public void DrawImage(PdfImage image, PointF point, SizeF size)
    Parameters
    Type Name Description
    PdfImage image

    PdfImage to draw.

    PointF point

    Point structure that represents the location of the upper-left corner of the drawn image.

    SizeF size

    SizeF structure that represents the height and width of the drawn image.

    Examples
    //Creates a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Adds a page to the document.
    PdfPage page = doc.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics g = page.Graphics;
    //Creates an image object.
    PdfBitmap image = new PdfBitmap("Autumn Leaves.jpg");
    //Draws the image.
    g.DrawImage(image, new PointF(0, 0), new SizeF(300, 200));
    //Saves the document.
    doc.Save("Output.pdf");
    //Closes the document.
    doc.Close(true);
    'Creates a new PDF document.
    Dim doc As New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Creates PDF graphics for the page.
    Dim g As PdfGraphics = page.Graphics
    'Creates an image object.
    Dim image As New PdfBitmap("Autumn Leaves.jpg")
    'Draws the image.
    g.DrawImage(image,New PointF(0, 0), New SizeF(300, 200))
    'Saves the document.
    doc.Save("Output.pdf")
    'Closes the document.
    doc.Close()

    DrawImage(PdfImage, RectangleF)

    Draws the specified Image at the specified location and with the specified size.

    Declaration
    public void DrawImage(PdfImage image, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfImage image

    PdfImage to draw.

    RectangleF rectangle

    RectangleF structure that specifies the location and size of the drawn image.

    Examples
    //Creates a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Adds a page to the document.
    PdfPage page = doc.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics g = page.Graphics;
    //Creates an image object.
    PdfBitmap image = new PdfBitmap("Autumn Leaves.jpg");
    //Draws the image.
    g.DrawImage(image, new RectangleF(0, 0, 300, 200));
    //Saves the document.
    doc.Save("Output.pdf");
    //Closes the document.
    doc.Close(true);
    'Creates a new PDF document.
    Dim doc As New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Creates PDF graphics for the page.
    Dim g As PdfGraphics = page.Graphics
    'Creates an image object.
    Dim image As New PdfBitmap("Autumn Leaves.jpg")
    'Draws the image.
    g.DrawImage(image,New RectangleF(0, 0, 300, 200))
    'Saves the document.
    doc.Save("Output.pdf")
    'Closes the document.
    doc.Close()

    DrawImage(PdfImage, Single, Single)

    Draws the specified image, using its original physical size, at the location specified by a coordinate pair.

    Declaration
    public void DrawImage(PdfImage image, float x, float y)
    Parameters
    Type Name Description
    PdfImage image

    PdfImage to draw.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn image.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn image.

    Examples
    //Creates a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Adds a page to the document.
    PdfPage page = doc.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics g = page.Graphics;
    //Creates an image object.
    PdfBitmap image = new PdfBitmap("Autumn Leaves.jpg");
    //Draws the image.
    g.DrawImage(image, 0, 0);
    //Saves the document.
    doc.Save("Output.pdf");
    //Closes the document.
    doc.Close(true);
    'Creates a new PDF document.
    Dim doc As New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Creates PDF graphics for the page.
    Dim g As PdfGraphics = page.Graphics
    'Creates an image object.
    Dim image As New PdfBitmap("Autumn Leaves.jpg")
    'Draws the image.
    g.DrawImage(image, 0, 0)
    'Saves the document.
    doc.Save("Output.pdf")
    'Closes the document.
    doc.Close()

    DrawImage(PdfImage, Single, Single, Single, Single)

    Draws the specified image, using its original physical size, at the location specified by a coordinate pair.

    Declaration
    public void DrawImage(PdfImage image, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfImage image

    PdfImage to draw.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn image.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn image.

    System.Single width

    Width of the drawn image.

    System.Single height

    Height of the drawn image.

    Examples
    //Creates a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Adds a page to the document.
    PdfPage page = doc.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics g = page.Graphics;
    //Creates an image object.
    PdfBitmap image = new PdfBitmap("Autumn Leaves.jpg");
    //Draws the image.
    g.DrawImage(image, 0, 0, 300, 200);
    //Saves the document.
    doc.Save("Output.pdf");
    //Closes the document.
    doc.Close(true);
    'Creates a new PDF document.
    Dim doc As New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = doc.Pages.Add()
    'Creates PDF graphics for the page.
    Dim g As PdfGraphics = page.Graphics
    'Creates an image object.
    Dim image As New PdfBitmap("Autumn Leaves.jpg")
    'Draws the image.
    g.DrawImage(image, 0, 0, 300, 200)
    'Saves the document.
    doc.Save("Output.pdf")
    'Closes the document.
    doc.Close()

    DrawLine(PdfPen, PointF, PointF)

    Declaration
    public void DrawLine(PdfPen pen, PointF point1, PointF point2)
    Parameters
    Type Name Description
    PdfPen pen
    PointF point1
    PointF point2

    DrawLine(PdfPen, Single, Single, Single, Single)

    Declaration
    public void DrawLine(PdfPen pen, float x1, float y1, float x2, float y2)
    Parameters
    Type Name Description
    PdfPen pen
    System.Single x1
    System.Single y1
    System.Single x2
    System.Single y2

    DrawPath(PdfBrush, PdfPath)

    Declaration
    public void DrawPath(PdfBrush brush, PdfPath path)
    Parameters
    Type Name Description
    PdfBrush brush
    PdfPath path

    DrawPath(PdfPen, PdfBrush, PdfPath)

    Declaration
    public void DrawPath(PdfPen pen, PdfBrush brush, PdfPath path)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    PdfPath path

    DrawPath(PdfPen, PdfPath)

    Declaration
    public void DrawPath(PdfPen pen, PdfPath path)
    Parameters
    Type Name Description
    PdfPen pen
    PdfPath path

    DrawPdfTemplate(PdfTemplate, PointF)

    Draws a template using its original size, at the specified location.

    Declaration
    public void DrawPdfTemplate(PdfTemplate template, PointF location)
    Parameters
    Type Name Description
    PdfTemplate template

    PdfTemplate object.

    PointF location

    PointF structure that specifies the upper-left corner of the drawn template.

    Examples
    //Creates a new PDF document.
    PdfDocument pdfDocument = new PdfDocument();
    //Adds a page to the PDF document.
    PdfPage pdfPage = pdfDocument.Pages.Add();
    //Create a PDF Template.
    PdfTemplate template = new PdfTemplate(100, 50);
    //Draws a rectangle into the graphics of the template.
    template.Graphics.DrawRectangle(PdfBrushes.BurlyWood, new System.Drawing.RectangleF(0, 0, 100, 50));
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 14);
    PdfBrush brush = new PdfSolidBrush(Color.Black);
    //Draws a string into the graphics of the template.
    template.Graphics.DrawString("Hello World", font, brush, 5, 5);
    //Draws the template into the page graphics of the document.
    pdfPage.Graphics.DrawPdfTemplate(template, PointF.Empty);
    //Saves the document.
    pdfDocument.Save("Output.pdf");
    //Close the document
    pdfDocument.Close(true);
    'Creates a new PDF document.
    Dim pdfDocument As New PdfDocument()
    'Adds a page to the PDF document
    Dim pdfPage As PdfPage = pdfDocument.Pages.Add()
    'Creates a PDF Template.
    Dim template As New PdfTemplate(100, 50)
    'Draws a rectangle into the graphics of the template.
    template.Graphics.DrawRectangle(PdfBrushes.BurlyWood, New System.Drawing.RectangleF(0, 0, 100, 50))
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14)
    Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
    'Draws a string into the graphics of the template.
    template.Graphics.DrawString("Hello World", font, brush, 5, 5)
    'Draws the template into the page graphics of the document.
    pdfPage.Graphics.DrawPdfTemplate(template, PointF.Empty)
    'Saves the document.
    pdfDocument.Save("Output.pdf")
    'Close the document
    pdfDocument.Close(True)

    DrawPdfTemplate(PdfTemplate, PointF, SizeF)

    Draws a template at the specified location and size.

    Declaration
    public void DrawPdfTemplate(PdfTemplate template, PointF location, SizeF size)
    Parameters
    Type Name Description
    PdfTemplate template

    PdfTemplate object.

    PointF location

    PointF structure that specifies the upper-left corner of the drawn template.

    SizeF size

    Size of the template.

    Examples
    //Creates a new PDF document.
    PdfDocument pdfDocument = new PdfDocument();
    //Adds a page to the PDF document.
    PdfPage pdfPage = pdfDocument.Pages.Add();
    //Create a PDF Template.
    PdfTemplate template = new PdfTemplate(100, 50);
    //Draws a rectangle into the graphics of the template.
    template.Graphics.DrawRectangle(PdfBrushes.BurlyWood, new System.Drawing.RectangleF(0, 0, 100, 50));
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 14);
    PdfBrush brush = new PdfSolidBrush(Color.Black);
    //Draws a string into the graphics of the template.
    template.Graphics.DrawString("Hello World", font, brush, 5, 5);
    //Draws the template into the page graphics of the document.
    pdfPage.Graphics.DrawPdfTemplate(template, PointF.Empty, template.Size);
    //Saves the document.
    pdfDocument.Save("Output.pdf");
    //Close the document
    pdfDocument.Close(true);
    'Creates a new PDF document.
    Dim pdfDocument As New PdfDocument()
    'Adds a page to the PDF document
    Dim pdfPage As PdfPage = pdfDocument.Pages.Add()
    'Creates a PDF Template.
    Dim template As New PdfTemplate(100, 50)
    'Draws a rectangle into the graphics of the template.
    template.Graphics.DrawRectangle(PdfBrushes.BurlyWood, New System.Drawing.RectangleF(0, 0, 100, 50))
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 14)
    Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
    'Draws a string into the graphics of the template.
    template.Graphics.DrawString("Hello World", font, brush, 5, 5)
    'Draws the template into the page graphics of the document.
    pdfPage.Graphics.DrawPdfTemplate(template, PointF.Empty, template.Size)
    'Saves the document.
    pdfDocument.Save("Output.pdf")
    'Close the document
    pdfDocument.Close(True)

    DrawPie(PdfBrush, RectangleF, Single, Single)

    Declaration
    public void DrawPie(PdfBrush brush, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfBrush brush
    RectangleF rectangle
    System.Single startAngle
    System.Single sweepAngle

    DrawPie(PdfBrush, Single, Single, Single, Single, Single, Single)

    Declaration
    public void DrawPie(PdfBrush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfBrush brush
    System.Single x
    System.Single y
    System.Single width
    System.Single height
    System.Single startAngle
    System.Single sweepAngle

    DrawPie(PdfPen, RectangleF, Single, Single)

    Declaration
    public void DrawPie(PdfPen pen, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen
    RectangleF rectangle
    System.Single startAngle
    System.Single sweepAngle

    DrawPie(PdfPen, PdfBrush, RectangleF, Single, Single)

    Declaration
    public void DrawPie(PdfPen pen, PdfBrush brush, RectangleF rectangle, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    RectangleF rectangle
    System.Single startAngle
    System.Single sweepAngle

    DrawPie(PdfPen, PdfBrush, Single, Single, Single, Single, Single, Single)

    Declaration
    public void DrawPie(PdfPen pen, PdfBrush brush, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    System.Single x
    System.Single y
    System.Single width
    System.Single height
    System.Single startAngle
    System.Single sweepAngle

    DrawPie(PdfPen, Single, Single, Single, Single, Single, Single)

    Declaration
    public void DrawPie(PdfPen pen, float x, float y, float width, float height, float startAngle, float sweepAngle)
    Parameters
    Type Name Description
    PdfPen pen
    System.Single x
    System.Single y
    System.Single width
    System.Single height
    System.Single startAngle
    System.Single sweepAngle

    DrawPolygon(PdfBrush, PointF[])

    Declaration
    public void DrawPolygon(PdfBrush brush, PointF[] points)
    Parameters
    Type Name Description
    PdfBrush brush
    PointF[] points

    DrawPolygon(PdfPen, PointF[])

    Declaration
    public void DrawPolygon(PdfPen pen, PointF[] points)
    Parameters
    Type Name Description
    PdfPen pen
    PointF[] points

    DrawPolygon(PdfPen, PdfBrush, PointF[])

    Declaration
    public void DrawPolygon(PdfPen pen, PdfBrush brush, PointF[] points)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    PointF[] points

    DrawRectangle(PdfBrush, RectangleF)

    Declaration
    public void DrawRectangle(PdfBrush brush, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfBrush brush
    RectangleF rectangle

    DrawRectangle(PdfBrush, Single, Single, Single, Single)

    Declaration
    public void DrawRectangle(PdfBrush brush, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfBrush brush
    System.Single x
    System.Single y
    System.Single width
    System.Single height

    DrawRectangle(PdfPen, RectangleF)

    Declaration
    public void DrawRectangle(PdfPen pen, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfPen pen
    RectangleF rectangle

    DrawRectangle(PdfPen, PdfBrush, RectangleF)

    Declaration
    public void DrawRectangle(PdfPen pen, PdfBrush brush, RectangleF rectangle)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    RectangleF rectangle

    DrawRectangle(PdfPen, PdfBrush, Single, Single, Single, Single)

    Declaration
    public void DrawRectangle(PdfPen pen, PdfBrush brush, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfPen pen
    PdfBrush brush
    System.Single x
    System.Single y
    System.Single width
    System.Single height

    DrawRectangle(PdfPen, Single, Single, Single, Single)

    Declaration
    public void DrawRectangle(PdfPen pen, float x, float y, float width, float height)
    Parameters
    Type Name Description
    PdfPen pen
    System.Single x
    System.Single y
    System.Single width
    System.Single height

    DrawString(String, PdfFont, PdfBrush, PointF)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfBrush brush, PointF point)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    PointF point

    PointF structure that specifies the upper-left corner of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;
    //Creates a solid brush.
    PdfBrush brush = new PdfSolidBrush(Color.Black);
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Draws the String.
    graphics.DrawString("Hello world!", font, brush, new PointF(20, 20));
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics
    'Creates a solid brush.
    Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Draws the text.
    graphics.DrawString("Hello world!", font, brush, New PointF(20,20))
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfBrush, PointF, PdfStringFormat)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfBrush brush, PointF point, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    PointF point

    PointF structure that specifies the upper-left corner of the drawn text.

    PdfStringFormat format

    The text string format.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;
    //Creates a solid brush.
    PdfBrush brush = new PdfSolidBrush(Color.Black);
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, brush, new PointF(20, 20), format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics
    'Creates a solid brush.
    Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, brush, New PointF(20,20), format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfBrush, RectangleF)

    Draws the specified text string at the specified location and size with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfBrush brush, RectangleF layoutRectangle)
    Parameters
    Type Name Description
    System.String s

    The text string.

    PdfFont font

    Font that defines the text format of the string.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    RectangleF layoutRectangle

    RectangleF structure that specifies the bounds of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, new RectangleF(20, 20, 200, 20));
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics      
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, New RectangleF(20, 20, 200, 20))
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfBrush, RectangleF, PdfStringFormat)

    Draws the specified text string at the specified location and size with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfBrush brush, RectangleF layoutRectangle, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    RectangleF layoutRectangle

    RectangleF structure that specifies the bounds of the drawn text.

    PdfStringFormat format

    StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, new RectangleF(20, 20, 200, 20), format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, New RectangleF(20, 20, 200, 20), format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfBrush, Single, Single)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfBrush brush, float x, float y)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    System.Single x

    The x.

    System.Single y

    The y.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);       
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, 20, 20);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)       
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, 20,20)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfBrush, Single, Single, PdfStringFormat)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfBrush brush, float x, float y, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn text.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn text.

    PdfStringFormat format

    The text string format.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;
    //Creates a solid brush.
    PdfBrush brush = new PdfSolidBrush(Color.Black);
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, brush, 20, 20, format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics
    'Creates a solid brush.
    Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, brush, 20,20, format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PointF)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PointF point)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PointF point

    PointF structure that specifies the upper-left corner of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);       
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, new PointF(20, 20));
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)       
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, New PointF(20,20))
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PointF, PdfStringFormat)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PointF point, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PointF point

    PointF structure that specifies the upper-left corner of the drawn text.

    PdfStringFormat format

    The text string format.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, new PointF(20, 20), format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, New PointF(20,20), format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, RectangleF)

    Draws the specified text string at the specified location and size with the specified Pen and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, RectangleF layoutRectangle)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    RectangleF layoutRectangle

    RectangleF structure that specifies the bounds of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, new RectangleF(20, 20, 200, 20));
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics      
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, New RectangleF(20, 20, 200, 20))
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, RectangleF, PdfStringFormat)

    Draws the specified text string at the specified location and size with the specified Pen and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, RectangleF layoutRectangle, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    RectangleF layoutRectangle

    RectangleF structure that specifies the bounds of the drawn text.

    PdfStringFormat format

    StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, new RectangleF(20, 20, 200, 20), format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, New RectangleF(20, 20, 200, 20), format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PdfBrush, PointF)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PdfBrush brush, PointF point)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    PointF point

    PointF structure that specifies the upper-left corner of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, new PointF(20, 20));
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics      
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, New PointF(20, 20))
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PdfBrush, PointF, PdfStringFormat)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PdfBrush brush, PointF point, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    PointF point

    PointF structure that specifies the upper-left corner of the drawn text.

    PdfStringFormat format

    StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, new PointF(20, 20), format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, New PointF(20,20), format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PdfBrush, RectangleF, PdfStringFormat)

    Draws the specified text string at the specified location and size with the specified Pen, Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PdfBrush brush, RectangleF layoutRectangle, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PdfBrush brush

    The brush.

    RectangleF layoutRectangle

    RectangleF structure that specifies the bounds of the drawn text.

    PdfStringFormat format

    StringFormat that specifies formatting attributes, such as line spacing and alignment, that are applied to the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, new RectangleF(20, 20, 200, 20), format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, New RectangleF(20, 20, 200, 20), format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PdfBrush, Single, Single)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PdfBrush brush, float x, float y)
    Parameters
    Type Name Description
    System.String s

    The text string.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn text.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, 20, 20);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics      
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, 20, 20)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, PdfBrush, Single, Single, PdfStringFormat)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, PdfBrush brush, float x, float y, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    The text string.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    PdfBrush brush

    Brush that determines the color and texture of the drawn text.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn text.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn text.

    PdfStringFormat format

    The text string format.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, 20, 20, format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, PdfBrushes.Green, 20,20, format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, Single, Single)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, float x, float y)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string.

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn text.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn text.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 20, 20);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics      
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 20, 20)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    DrawString(String, PdfFont, PdfPen, Single, Single, PdfStringFormat)

    Draws the specified text string at the specified location with the specified Brush and Font objects.

    Declaration
    public void DrawString(string s, PdfFont font, PdfPen pen, float x, float y, PdfStringFormat format)
    Parameters
    Type Name Description
    System.String s

    String to draw.

    PdfFont font

    Font that defines the text format of the string..

    PdfPen pen

    Pen that determines the color, width, and style of the path.

    System.Single x

    The x-coordinate of the upper-left corner of the drawn text.

    System.Single y

    The y-coordinate of the upper-left corner of the drawn text.

    PdfStringFormat format

    The text string format.

    Examples
    //Creates a new PDF document.
    PdfDocument document = new PdfDocument();
    //Adds a page.PdfPage 
    PdfPage page = document.Pages.Add();
    //Creates PDF graphics for the page.
    PdfGraphics graphics = page.Graphics;       
    //Sets the font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
    //Create PDF string format.
    PdfStringFormat format = new PdfStringFormat();
    //Set text alignement.
    format.Alignment = PdfTextAlignment.Left;
    format.LineAlignment = PdfVerticalAlignment.Top;
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 20, 20, format);
    //Saves the document.
    document.Save("Sample.pdf");
    //Closes the document.
    document.Close(true);
    'Creates a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Adds a page to the document.
    Dim page As PdfPage = document.Pages.Add()
    'Creates PDF graphics for the page.
    Dim graphics As PdfGraphics = page.Graphics        
    'Sets the font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
    'Create PDF string format.
    Dim format As New PdfStringFormat()
    'Set text alignement.
    format.Alignment = PdfTextAlignment.Left
    format.LineAlignment = PdfVerticalAlignment.Top
    'Draws the text.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 20,20, format)
    'Saves the document.
    document.Save("Sample.pdf")
    'Closes the document
    document.Close(true)

    Flush()

    Forces execution of all pending graphics operations and returns immediately without waiting for the operations to finish.

    Declaration
    public void Flush()
    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Draw string to PDF page graphics.
    graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty);
    //Draw the rectangle to PDF page graphics.
    graphics.DrawRectangle(PdfPens.Red, new RectangleF(0, 20, 200, 100));
    graphics.Flush();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Draw string to PDF page graphics.
    graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty)
    'Draw the rectangle to PDF page graphics.
    graphics.DrawRectangle(PdfPens.Red, New RectangleF(0, 20, 200, 100))
    graphics.Flush()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    OnStructElementChanged(PdfTag)

    Raise the event on property changed.

    Declaration
    protected void OnStructElementChanged(PdfTag tag)
    Parameters
    Type Name Description
    PdfTag tag

    Restore()

    Restores the state of this Graphics to the state represented by a GraphicsState.

    Declaration
    public void Restore()
    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    graphics.Save();
    //Set graphics translate transform.
    graphics.TranslateTransform(100, 100);            
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);
    //Restore the graphics.
    graphics.Restore();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    graphics.Save()
    'Set graphics translate transform.
    graphics.TranslateTransform(100, 100)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)
    'Restore the graphics.
    graphics.Restore()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Restore(PdfGraphicsState)

    Restores the state of this Graphics to the state represented by a GraphicsState.

    Declaration
    public void Restore(PdfGraphicsState state)
    Parameters
    Type Name Description
    PdfGraphicsState state

    GraphicsState that represents the state to which to restore this Graphics.

    Remarks

    This method works similar to method.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    PdfGraphicsState state = graphics.Save();
    //Set graphics translate transform.
    graphics.TranslateTransform(100, 100);            
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);
    //Restore the graphics.
    graphics.Restore(state);
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    Dim state As PdfGraphicsState = graphics.Save()
    'Set graphics translate transform.
    graphics.TranslateTransform(100, 100)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)
    'Restore the graphics.
    graphics.Restore(state)
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    RotateTransform(Single)

    Applies the specified rotation to the transformation matrix of this Graphics.

    Declaration
    public void RotateTransform(float angle)
    Parameters
    Type Name Description
    System.Single angle

    Angle of rotation in degrees.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    graphics.Save();
    //Set rotate transform
    graphics.RotateTransform(-90);            
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, -100, 0);
    //Restore the graphics.
    graphics.Restore();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    graphics.Save()
    'Set rotate transform
    graphics.RotateTransform(-90)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, -100, 0)
    'Restore the graphics.
    graphics.Restore()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    Save()

    Saves the current state of this Graphics and identifies the saved state with a GraphicsState.

    Declaration
    public PdfGraphicsState Save()
    Returns
    Type Description
    PdfGraphicsState

    This method returns a GraphicsState that represents the saved state of this Graphics.

    Remarks

    This method works similar to method.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    graphics.Save();
    //Set graphics translate transform.
    graphics.TranslateTransform(100, 100);            
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);
    //Restore the graphics.
    graphics.Restore();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    graphics.Save()
    'Set graphics translate transform.
    graphics.TranslateTransform(100, 100)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)
    'Restore the graphics.
    graphics.Restore()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    ScaleTransform(Single, Single)

    Applies the specified scaling operation to the transformation matrix of this Graphics by prepending it to the object's transformation matrix.

    Declaration
    public void ScaleTransform(float scaleX, float scaleY)
    Parameters
    Type Name Description
    System.Single scaleX

    Scale factor in the x direction.

    System.Single scaleY

    Scale factor in the y direction.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    graphics.Save();
    //Scale transform
    graphics.ScaleTransform(0.5f, 0.5f);             
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);
    //Restore the graphics.
    graphics.Restore();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    graphics.Save()
    'Scale transform
    graphics.ScaleTransform(0.5F, 0.5F)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)
    'Restore the graphics.
    graphics.Restore()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetClip(RectangleF)

    Sets the clipping region of this Graphics to the rectangle specified by a RectangleF structure.

    Declaration
    public void SetClip(RectangleF rectangle)
    Parameters
    Type Name Description
    RectangleF rectangle

    RectangleF structure that represents the new clip region.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //set clip.
    graphics.SetClip(new RectangleF(0, 0, 50, 12));          
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'set clip.
    graphics.SetClip(New RectangleF(0, 0, 50, 12))
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetClip(RectangleF, PdfFillMode)

    Sets the clipping region of this Graphics to the result of the specified operation combining the current clip region and the rectangle specified by a RectangleF structure.

    Declaration
    public void SetClip(RectangleF rectangle, PdfFillMode mode)
    Parameters
    Type Name Description
    RectangleF rectangle

    RectangleF structure to combine.

    PdfFillMode mode

    Member of the PdfFillMode enumeration that specifies the filling operation to use.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //set clip.
    graphics.SetClip(new RectangleF(0, 0, 50, 12), PdfFillMode.Alternate);          
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'set clip.
    graphics.SetClip(New RectangleF(0, 0, 50, 12), PdfFillMode.Alternate)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetClip(PdfPath)

    Sets the clipping region of this Graphics to the result of the specified operation combining the current clip region and the specified PdfPath.

    Declaration
    public void SetClip(PdfPath path)
    Parameters
    Type Name Description
    PdfPath path

    PdfPath to clip.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Create PDF path.
    PdfPath path = new PdfPath();
    path.AddRectangle(new RectangleF(0, 0, 50, 12));
    //set clip.
    graphics.SetClip(path);          
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Create PDF path.
    Dim path As New PdfPath()
    path.AddRectangle(New RectangleF(0, 0, 50, 12))
    'set clip.
    graphics.SetClip(path)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetClip(PdfPath, PdfFillMode)

    Modifying the current clipping path by intersecting it with the current path.

    Declaration
    public void SetClip(PdfPath path, PdfFillMode mode)
    Parameters
    Type Name Description
    PdfPath path

    PdfPath to fill.

    PdfFillMode mode

    Member of the PdfFillMode enumeration that specifies the filling operation to use.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Create PDF path.
    PdfPath path = new PdfPath();
    path.AddRectangle(new RectangleF(0, 0, 50, 12));
    //set clip.
    graphics.SetClip(path, PdfFillMode.Alternate);          
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Create PDF path.
    Dim path As New PdfPath()
    path.AddRectangle(New RectangleF(0, 0, 50, 12))
    'set clip.
    graphics.SetClip(path, PdfFillMode.Alternate)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetTransparency(Single)

    Sets the transparency of this Graphics with the specified value for pen

    Declaration
    public void SetTransparency(float alpha)
    Parameters
    Type Name Description
    System.Single alpha

    The alpha value for both pen and brush operations.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Set transparancy.
    graphics.SetTransparency(0.5f);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfBrushes.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Set transparancy.
    graphics.SetTransparency(0.5F)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfBrueshes.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetTransparency(Single, Single)

    Sets the transparency of this Graphics with the specified value for pen and brush

    Declaration
    public void SetTransparency(float alphaPen, float alphaBrush)
    Parameters
    Type Name Description
    System.Single alphaPen

    The alpha value for pen operations.

    System.Single alphaBrush

    The alpha value for brush operations.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Set transparancy.
    graphics.SetTransparency(0.5f, 0.5f);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Black, PdfBrushes.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Set transparancy.
    graphics.SetTransparency(0.5F, 0.5F)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Black, PdfBrueshes.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SetTransparency(Single, Single, PdfBlendMode)

    Sets the transparency of this Graphics with the specified PdfBlendMode

    Declaration
    public void SetTransparency(float alphaPen, float alphaBrush, PdfBlendMode blendMode)
    Parameters
    Type Name Description
    System.Single alphaPen

    The alpha value for pen operations.

    System.Single alphaBrush

    The alpha value for brush operations.

    PdfBlendMode blendMode

    The blend mode.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Set transparancy.
    graphics.SetTransparency(0.5f, 0.5f, PdfBlendMode.HardLight);
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Black, PdfBrushes.Red, 0, 0);        
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Set transparancy.
    graphics.SetTransparency(0.5F, 0.5F, PdfBlendMode.HardLight)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Black, PdfBrueshes.Red, 0, 0)        
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    SkewTransform(Single, Single)

    Skews the coordinate system axes.

    Declaration
    public void SkewTransform(float angleX, float angleY)
    Parameters
    Type Name Description
    System.Single angleX

    Skews the X axis by this angle (in degrees).

    System.Single angleY

    Skews the Y axis by this angle (in degrees).

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    graphics.Save();
    //Set skew transform
    graphics.SkewTransform(10,10);                
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);
    //Restore the graphics.
    graphics.Restore();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    graphics.Save()
    'Set skew transform
    graphics.SkewTransform(10, 10)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)
    'Restore the graphics.
    graphics.Restore()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)

    TranslateTransform(Single, Single)

    Changes the origin of the coordinate system by prepending the specified translation to the transformation matrix of this Graphics.

    Declaration
    public void TranslateTransform(float offsetX, float offsetY)
    Parameters
    Type Name Description
    System.Single offsetX

    The x-coordinate of the translation.

    System.Single offsetY

    The y-coordinate of the translation.

    Examples
    // Create a PDF Document.
    PdfDocument doc = new PdfDocument();
    //Add pages to the document
    PdfPage page = doc.Pages.Add();
    //Create PDF graphics for the page
    PdfGraphics graphics = page.Graphics;
    //Create PDF font.
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
    //Save the graphics.
    graphics.Save();
    //Set graphics translate transform.
    graphics.TranslateTransform(100, 100);            
    //Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0);
    //Restore the graphics.
    graphics.Restore();
    //Save the document
    doc.Save("Output.pdf");
    //Close the document
    doc.Close(true);
    ' Create a PDF Document.
    Dim doc As New PdfDocument()
    'Add pages to the document
    Dim page As PdfPage = doc.Pages.Add()
    'Create PDF graphics for the page
    Dim graphics As PdfGraphics = page.Graphics
    'Create PDF font.
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
    'Save the graphics.
    graphics.Save()
    'Set graphics translate transform.
    graphics.TranslateTransform(100, 100)
    'Draws the String.
    graphics.DrawString("Hello world!", font, PdfPens.Red, 0, 0)
    'Restore the graphics.
    graphics.Restore()
    'Save the document
    doc.Save("Output.pdf")
    'Close the document
    doc.Close(True)
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved