System.Drawing.Printing.PrinterSettings.CreateMeasurementGraphics Method

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

Syntax

public System.Drawing.Graphics CreateMeasurementGraphics (PageSettings pageSettings, bool honorOriginAtMargins)

Parameters

pageSettings
The System.Drawing.Printing.PageSettings to retrieve a System.Drawing.Graphics object for.
honorOriginAtMargins
true to specify the origin at the margins; otherwise, false.

Returns

A System.Drawing.Graphics that contains printer information from the System.Drawing.Printing.PageSettings.

Remarks

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

Requirements

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