PrintDocument.OriginAtMargins Property

Definition

Gets or sets a value indicating whether the position of a graphics object associated with a page is located just inside the user-specified margins or at the top-left corner of the printable area of the page.

C#
public bool OriginAtMargins { get; set; }

Property Value

true if the graphics origin starts at the page margins; false if the graphics origin is at the top-left corner of the printable page. The default is false.

Remarks

Calculating the area available to print requires knowing the physical size of the paper, the margins for the page, and the location of the Graphics object origin. When OriginAtMargins is true, the Graphics object location takes into account the PageSettings.Margins property value and the printable area of the page. When OriginAtMargins is false, only the printable area of the page is used to determine the location of the Graphics object origin, the PageSettings.Margins value is ignored.

For example, if OriginAtMargins is true, and PageSettings.Margins is set for 1 inch on each side, the Graphics object included in the PrintPageEventArgs is located 1 inch from the left and top of the page. If the printable area of the page is .25 of an inch on each side and OriginAtMargins is false, the Graphics object is located .25 of an inch from the left and top of the page.

Note

The printable area of a page varies from printer to printer and is not guaranteed to be symmetrical.

Applies to

Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10