<PackageReference Include="System.Drawing.Common" Version="9.0.5" />

PrinterSettings

public class PrinterSettings : ICloneable
Specifies information about how a document is printed, including the printer that prints it, when printing from a Windows Forms application.

Contains a collection of PaperSize objects.

Contains a collection of PaperSource objects.

Contains a collection of PrinterResolution objects.

Contains a collection of String objects.

public static StringCollection InstalledPrinters { get; }

Gets the names of all printers installed on the computer.

public bool CanDuplex { get; }

Gets a value indicating whether the printer supports double-sided printing.

public bool Collate { get; set; }

Gets or sets a value indicating whether the printed document is collated.

public short Copies { get; set; }

Gets or sets the number of copies of the document to print.

Gets the default page settings for this printer.

public Duplex Duplex { get; set; }

Gets or sets the printer setting for double-sided printing.

public int FromPage { get; set; }

Gets or sets the page number of the first page to print.

public bool IsDefaultPrinter { get; }

Gets a value indicating whether the PrinterName property designates the default printer, except when the user explicitly sets PrinterName.

public bool IsPlotter { get; }

Gets a value indicating whether the printer is a plotter.

public bool IsValid { get; }

Gets a value indicating whether the PrinterName property designates a valid printer.

public int LandscapeAngle { get; }

Gets the angle, in degrees, that the portrait orientation is rotated to produce the landscape orientation.

public int MaximumCopies { get; }

Gets the maximum number of copies that the printer enables the user to print at a time.

public int MaximumPage { get; set; }

Gets or sets the maximum FromPage or ToPage that can be selected in a PrintDialog.

public int MinimumPage { get; set; }

Gets or sets the minimum FromPage or ToPage that can be selected in a PrintDialog.

Gets the paper sizes that are supported by this printer.

Gets the paper source trays that are available on the printer.

public string PrinterName { get; set; }

Gets or sets the name of the printer to use.

Gets all the resolutions that are supported by this printer.

public string PrintFileName { get; set; }

Gets or sets the file name, when printing to a file.

public PrintRange PrintRange { get; set; }

Gets or sets the page numbers that the user has specified to be printed.

public bool PrintToFile { get; set; }

Gets or sets a value indicating whether the printing output is sent to a file instead of a port.

public bool SupportsColor { get; }

Gets a value indicating whether this printer supports color printing.

public int ToPage { get; set; }

Gets or sets the number of the last page to print.

public PrinterSettings()

Initializes a new instance of the PrinterSettings class.

public object Clone()

Creates a copy of this PrinterSettings.

Returns a Graphics that contains printer information that is useful when creating a PrintDocument.

public Graphics CreateMeasurementGraphics(bool honorOriginAtMargins)

Returns a Graphics that contains printer information, optionally specifying the origin at the margins.

Returns a Graphics that contains printer information associated with the specified PageSettings.

public Graphics CreateMeasurementGraphics(PageSettings pageSettings, bool honorOriginAtMargins)

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

public IntPtr GetHdevmode()

Creates a handle to a DEVMODE structure that corresponds to the printer settings.

public IntPtr GetHdevmode(PageSettings pageSettings)

Creates a handle to a DEVMODE structure that corresponds to the printer and the page settings specified through the pageSettings parameter.

public IntPtr GetHdevnames()

Creates a handle to a DEVNAMES structure that corresponds to the printer settings.

public bool IsDirectPrintingSupported(Image image)

Gets a value indicating whether the printer supports printing the specified image file.

public bool IsDirectPrintingSupported(ImageFormat imageFormat)

Returns a value indicating whether the printer supports printing the specified image format.

public void SetHdevmode(IntPtr hdevmode)

Copies the relevant information out of the given handle and into the PrinterSettings.

public void SetHdevnames(IntPtr hdevnames)

Copies the relevant information out of the given handle and into the PrinterSettings.