Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfGraphicsUnit

    Specifies the types of the page's logical units.

    Inheritance
    System.Object
    PdfGraphicsUnit
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfGraphicsUnit : Enum
    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

    Centimeter

    Specifies the Measurement is in centimeters.

    Declaration
    public const PdfGraphicsUnit Centimeter
    Field Value
    Type Description
    PdfGraphicsUnit

    Document

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

    Declaration
    public const PdfGraphicsUnit Document
    Field Value
    Type Description
    PdfGraphicsUnit

    Inch

    Specifies the inch as the unit of measure.

    Declaration
    public const PdfGraphicsUnit Inch
    Field Value
    Type Description
    PdfGraphicsUnit

    Millimeter

    Specifies the Measurement is in millimeters.

    Declaration
    public const PdfGraphicsUnit Millimeter
    Field Value
    Type Description
    PdfGraphicsUnit

    Pica

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

    Declaration
    public const PdfGraphicsUnit Pica
    Field Value
    Type Description
    PdfGraphicsUnit

    Pixel

    Specifies the unit of measurement is 1 pixel.

    Declaration
    public const PdfGraphicsUnit Pixel
    Field Value
    Type Description
    PdfGraphicsUnit
    Remarks

    Pixel unit is device dependent unit. The result depends on the default Dpi on the machine.

    Point

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

    Declaration
    public const PdfGraphicsUnit Point
    Field Value
    Type Description
    PdfGraphicsUnit

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved