File Formats

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum PdfGraphicsUnit

    Show / Hide Table of Contents

    Enum PdfGraphicsUnit

    Specifies the types of the page's logical units.

    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public enum PdfGraphicsUnit
    Examples
    //Create a new PDF document.
    PdfDocument doc = new PdfDocument();
    //Add a page to the document.
    PdfPage page = doc.Pages.Add();
    //Create new PDF unitconverter.
    PdfUnitConvertor converter = new PdfUnitConvertor();
    //Convert to pixels.
     RectangleF rect = converter.ConvertToPixels(new RectangleF(100, 100, 200, 100), PdfGraphicsUnit.Point);
     page.Graphics.DrawRectangle(PdfPens.Red, rect);
    //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 new PDF unitconverter.
    Dim converter As New PdfUnitConvertor()
    'Convert to pixels.
    Dim rect As RectangleF = converter.ConvertToPixels(New RectangleF(100, 100, 200, 100), PdfGraphicsUnit.Point)
    page.Graphics.DrawRectangle(PdfPens.Red, rect)
    'Save the document.
    doc.Save("Output.pdf")
    'Close the document.
    doc.Close(True)

    Fields

    Name Description
    Centimeter

    Specifies the Measurement is in centimeters.

    Document

    Specifies the document unit (1/300 inch) as the unit of measure.

    Inch

    Specifies the inch as the unit of measure.

    Millimeter

    Specifies the Measurement is in millimeters.

    Pica

    Specifies the Measurement is in picas. A pica represents 12 points.

    Pixel

    Specifies the unit of measurement is 1 pixel.

    Point

    Specifies a printer's point (1/72 inch) as the unit of measure.

    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved