PrinterSettings Class

 

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

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

System.Object
  System.Drawing.Printing.PrinterSettings

[<SerializableAttribute>]
type PrinterSettings = 
    class
        interface ICloneable
    end

NameDescription
System_CAPS_pubmethodPrinterSettings()

Initializes a new instance of the PrinterSettings class.

NameDescription
System_CAPS_pubpropertyCanDuplex

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

System_CAPS_pubpropertyCollate

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

System_CAPS_pubpropertyCopies

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

System_CAPS_pubpropertyDefaultPageSettings

Gets the default page settings for this printer.

System_CAPS_pubpropertyDuplex

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

System_CAPS_pubpropertyFromPage

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

System_CAPS_pubpropertySystem_CAPS_staticInstalledPrinters

Gets the names of all printers installed on the computer.

System_CAPS_pubpropertyIsDefaultPrinter

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

System_CAPS_pubpropertyIsPlotter

Gets a value indicating whether the printer is a plotter.

System_CAPS_pubpropertyIsValid

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

System_CAPS_pubpropertyLandscapeAngle

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

System_CAPS_pubpropertyMaximumCopies

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

System_CAPS_pubpropertyMaximumPage

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

System_CAPS_pubpropertyMinimumPage

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

System_CAPS_pubpropertyPaperSizes

Gets the paper sizes that are supported by this printer.

System_CAPS_pubpropertyPaperSources

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

System_CAPS_pubpropertyPrinterName

Gets or sets the name of the printer to use.

System_CAPS_pubpropertyPrinterResolutions

Gets all the resolutions that are supported by this printer.

System_CAPS_pubpropertyPrintFileName

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

System_CAPS_pubpropertyPrintRange

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

System_CAPS_pubpropertyPrintToFile

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

System_CAPS_pubpropertySupportsColor

Gets a value indicating whether this printer supports color printing.

System_CAPS_pubpropertyToPage

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

NameDescription
System_CAPS_pubmethodClone()

Creates a copy of this PrinterSettings.

System_CAPS_pubmethodCreateMeasurementGraphics()

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

System_CAPS_pubmethodCreateMeasurementGraphics(Boolean)

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

System_CAPS_pubmethodCreateMeasurementGraphics(PageSettings)

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

System_CAPS_pubmethodCreateMeasurementGraphics(PageSettings, Boolean)

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

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetHdevmode()

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

System_CAPS_pubmethodGetHdevmode(PageSettings)

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

System_CAPS_pubmethodGetHdevnames()

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

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIsDirectPrintingSupported(Image)

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

System_CAPS_pubmethodIsDirectPrintingSupported(ImageFormat)

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

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodSetHdevmode(IntPtr)

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

System_CAPS_pubmethodSetHdevnames(IntPtr)

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

System_CAPS_pubmethodToString()

This API supports the product infrastructure and is not intended to be used directly from your code. Provides information about the PrinterSettings in string form.(Overrides Object.ToString().)

Typically, you access a PrinterSettings 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.

Use the System.Drawing, System.Drawing.Printing, and System.IO namespaces for this example.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: