Represents a collection of methods and properties for managing the options which define how the content is to be printed.
The PrintTaskOptions class has these types of members:
The PrintTaskOptions class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|GetPageDescription||Retrieves the physical dimensions of the printed page.|
The PrintTaskOptions class has these properties.
|Read/write||Gets or sets the binding option for the print task.|
|Read/write||Gets or sets the collation option of the print tasks.|
|Read/write||Gets or sets the color mode option of the print task.|
|Read-only||Gets the list of options displayed for the print experience.|
|Read/write||Gets or sets the duplex option of the print task.|
|Read/write||Gets or sets the hole punch option of the print task.|
|Read-only||Gets the maximum number of copies supported for the print task.|
|Read/write||Gets or sets the media size option of the print task.|
|Read/write||Gets or sets the media type option for the print task.|
|Read-only||Gets the minimum number of copies allowed for the print task.|
|Read/write||Gets or sets the value for the number of copies for the print task.|
|Read/write||Gets or sets the orientation option for the print task.|
|Read/write||Gets or sets the print quality option for the print task.|
|Read/write||Gets or sets the staple option for the print task.|
The PrintTaskOptions class provides access to the different values that define how the content in the print task is to be formatted during printing. The PrintTaskOptions object may contain information like the size of the printed page, its orientation, and the type of media on which the content will be printed. In addition the PrintTaskOptions object provides access to the list of options to be displayed in the print window.
While each option in PrintTaskOptions, for example MediaSize or MediaType, has a specific set of supported values all the options support the same general pattern for representing some common cases. The common case values are Default, NotAvailable and PrinterCustom.
Each option contains a default value, and it is the value that is assigned to the option by the print target. When this value is retrieved via a property access, it is an indication that the print target has not yet determined the actual value for this option. When you set the default value for a particular option, it indicates to the print target that it must use the default value that it has for that option. If there is no default value for that option, then the option value is unchanged.
An option may also report a NotAvailable value. This indicates that the specific option is not available for the currently selected print target. For example, if the Duplex property returns a NotAvailable value, it indicates that the print target does not support duplex functionality. It is not possible to set an option to the NotAvailable value.
The final value that is common to all options is PrinterCustom. This indicates that the print target supports the functionality but the current selection is custom to this printer. For example, a print target may support a special method for binding the document that is not one of the standard values. In this case a property query on the Binding option will return the PrinterCustom value. Custom output sizes will also be represented as PrinterCustom values but the actual physical sizes will still be available via the GetPageDescription method.
An app may also use PrintTaskOptions to customize the options that appear in the print window. The DisplayedOptions property returns a vector containing the list of option items that will be displayed. Modifications to this list by inserting, appending, removing, or re-ordering options will be reflected in the print window. If a particular print target does not support an option, the option will not be displayed to the user. For the names of the standard options, see StandardPrintTaskOptions.
// Set output to color printTaskOptions.colorMode = colorMode; // Set the media size for printing printTaskOptions.mediaSize = mediaSize;
Minimum supported client
|Windows 8 [Windows Store apps only]|
Minimum supported server
|Windows Server 2012 [Windows Store apps only]|
Build date: 11/16/2013