PageSettings Class
Specifies settings that apply to a single, printed page.
Assembly: System.Drawing (in System.Drawing.dll)
The PageSettings type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | PageSettings() | Initializes a new instance of the PageSettings class using the default printer. |
![]() | PageSettings(PrinterSettings) | Initializes a new instance of the PageSettings class using a specified printer. |
| Name | Description | |
|---|---|---|
![]() | Bounds | Gets the size of the page, taking into account the page orientation specified by the Landscape property. |
![]() | Color | Gets or sets a value indicating whether the page should be printed in color. |
![]() | HardMarginX | Gets the x-coordinate, in hundredths of an inch, of the hard margin at the left of the page. |
![]() | HardMarginY | Gets the y-coordinate, in hundredths of an inch, of the hard margin at the top of the page. |
![]() | Landscape | Gets or sets a value indicating whether the page is printed in landscape or portrait orientation. |
![]() | Margins | Gets or sets the margins for this page. |
![]() | PaperSize | Gets or sets the paper size for the page. |
![]() | PaperSource | Gets or sets the page's paper source; for example, the printer's upper tray. |
![]() | PrintableArea | Gets the bounds of the printable area of the page for the printer. |
![]() | PrinterResolution | Gets or sets the printer resolution for the page. |
![]() | PrinterSettings | Gets or sets the printer settings associated with the page. |
| Name | Description | |
|---|---|---|
![]() | Clone | Creates a copy of this PageSettings. |
![]() | CopyToHdevmode | Copies the relevant information from the PageSettings to the specified DEVMODE structure. |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | SetHdevmode | Copies relevant information to the PageSettings from the specified DEVMODE structure. |
![]() | ToString | Infrastructure. Converts the PageSettings to string form. (Overrides Object::ToString().) |
The PageSettings class is used to specify settings that modify the way a page will be printed. Typically, you set default settings for all pages to be printed through the PrintDocument::DefaultPageSettings property. To specify settings on a page-by-page basis, handle the PrintDocument::PrintPage or PrintDocument::QueryPageSettings event and modify the PageSettings argument included in the PrintPageEventArgs or QueryPageSettingsEventArgs, respectively.
For more information about handling PrintDocument events, see the PrintDocument class overview. For more information about printing, see the System.Drawing.Printing namespace overview.
The following example demonstrates handling the PrintPage event and checking the PageSettings argument of PrintPageEventArgs. To use this code, add a PrintDocument component named PrintDocument1 to a Windows Form and associate its PrintPage event with the printDocument1_PrintPage method in the example.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
