Class PdfGraphicsUnit
Specifies the types of the page's logical units.
Inheritance
System.Object
PdfGraphicsUnit
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.NET.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 |
---|
PdfGraphicsUnit |
Document
Specifies the document unit (1/300 inch) as the unit of measure.
Declaration
public const PdfGraphicsUnit Document
Field Value
Type |
---|
PdfGraphicsUnit |
Inch
Specifies the inch as the unit of measure.
Declaration
public const PdfGraphicsUnit Inch
Field Value
Type |
---|
PdfGraphicsUnit |
Millimeter
Specifies the Measurement is in millimeters.
Declaration
public const PdfGraphicsUnit Millimeter
Field Value
Type |
---|
PdfGraphicsUnit |
Pica
Specifies the Measurement is in picas. A pica represents 12 points.
Declaration
public const PdfGraphicsUnit Pica
Field Value
Type |
---|
PdfGraphicsUnit |
Pixel
Specifies the unit of measurement is 1 pixel.
Declaration
public const PdfGraphicsUnit Pixel
Field Value
Type |
---|
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 |
---|
PdfGraphicsUnit |