Specifies information about how a document is printed, including the printer that prints it, when printing from a Windows Forms application.
Assembly: System.Drawing (in System.Drawing.dll)
Thetype exposes the following members.
|CanDuplex||Gets a value indicating whether the printer supports double-sided printing.|
|Collate||Gets or sets a value indicating whether the printed document is collated.|
|Copies||Gets or sets the number of copies of the document to print.|
|DefaultPageSettings||Gets the default page settings for this printer.|
|Duplex||Gets or sets the printer setting for double-sided printing.|
|FromPage||Gets or sets the page number of the first page to print.|
|InstalledPrinters||Gets the names of all printers installed on the computer.|
|IsDefaultPrinter||Gets a value indicating whether the PrinterName property designates the default printer, except when the user explicitly sets PrinterName.|
|IsPlotter||Gets a value indicating whether the printer is a plotter.|
|IsValid||Gets a value indicating whether the PrinterName property designates a valid printer.|
|LandscapeAngle||Gets the angle, in degrees, that the portrait orientation is rotated to produce the landscape orientation.|
|MaximumCopies||Gets the maximum number of copies that the printer enables the user to print at a time.|
|MaximumPage||Gets or sets the maximum FromPage or ToPage that can be selected in a PrintDialog.|
|MinimumPage||Gets or sets the minimum FromPage or ToPage that can be selected in a PrintDialog.|
|PaperSizes||Gets the paper sizes that are supported by this printer.|
|PaperSources||Gets the paper source trays that are available on the printer.|
|PrinterName||Gets or sets the name of the printer to use.|
|PrinterResolutions||Gets all the resolutions that are supported by this printer.|
|PrintFileName||Gets or sets the file name, when printing to a file.|
|PrintRange||Gets or sets the page numbers that the user has specified to be printed.|
|PrintToFile||Gets or sets a value indicating whether the printing output is sent to a file instead of a port.|
|SupportsColor||Gets a value indicating whether this printer supports color printing.|
|ToPage||Gets or sets the number of the last page to print.|
|Clone||Creates a copy of this .|
|CreateMeasurementGraphics()||Returns a Graphics that contains printer information that is useful when creating a PrintDocument.|
|CreateMeasurementGraphics(Boolean)||Returns a Graphics that contains printer information, optionally specifying the origin at the margins.|
|CreateMeasurementGraphics(PageSettings)||Returns a Graphics that contains printer information associated with the specified PageSettings.|
|CreateMeasurementGraphics(PageSettings, Boolean)||Creates a Graphics associated with the specified page settings and optionally specifying the origin at the margins.|
|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 the default hash function. (Inherited from Object.)|
|GetHdevmode()||Creates a handle to a DEVMODE structure that corresponds to the printer settings.|
|GetHdevmode(PageSettings)||Creates a handle to a DEVMODE structure that corresponds to the printer and the page settings specified through the pageSettings parameter.|
|GetHdevnames||Creates a handle to a DEVNAMES structure that corresponds to the printer settings.|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|IsDirectPrintingSupported(Image)||Gets a value indicating whether the printer supports printing the specified image file.|
|IsDirectPrintingSupported(ImageFormat)||Returns a value indicating whether the printer supports printing the specified image format.|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|SetHdevmode||Copies the relevant information out of the given handle and into the .|
|SetHdevnames||Copies the relevant information out of the given handle and into the .|
|ToString||Infrastructure. Provides information about the in string form. (Overrides Object.ToString().)|
Typically, you access a through PrintDocument.PrinterSettings or PageSettings.PrinterSettings properties to modify printer settings. The most common printer setting is PrinterName, which specifies the printer to print to.
For more information about printing with Windows Forms, see the System.Drawing.Printing namespace overview. If you wish to print from a Windows Presentation Foundation application, see the System.Printing namespace.
The following code example prints a document on the specified printer. The example has three prerequisites:
A variable named filePath has been set to the path of the file to print.
A method named pd_PrintPage, which handles the PrintPage event, has been defined.
A variable named printer has been set to the printer's name.