PrinterSettings.CreateMeasurementGraphics Method (PageSettings, Boolean)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Creates a Graphics associated with the specified page settings and optionally specifying the origin at the margins.

Namespace:   System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

public Graphics CreateMeasurementGraphics(
	PageSettings pageSettings,
	bool honorOriginAtMargins


Type: System.Drawing.Printing.PageSettings

The PageSettings to retrieve a Graphics object for.

Type: System.Boolean

true to specify the origin at the margins; otherwise, false.

Return Value

Type: System.Drawing.Graphics

A Graphics that contains printer information from the PageSettings.

The CreateMeasurementGraphics method allows you to obtain a Graphics for the printer without creating a print job. Use the Graphics to make decisions on how to layout visual elements like fonts, sizes, and type styles of a complex print job.

.NET Framework
Available since 2.0
Return to top