PrintTaskOptions
PrintTaskOptions
PrintTaskOptions
PrintTaskOptions
Class
Definition
Represents a collection of methods and properties for managing the options which define how the content is to be printed.
public : sealed class PrintTaskOptions : IPrintTaskOptions, IPrintTaskOptionsCore, IPrintTaskOptionsCoreProperties, IPrintTaskOptionsCoreUIConfigurationpublic sealed class PrintTaskOptions : IPrintTaskOptions, IPrintTaskOptionsCore, IPrintTaskOptionsCoreProperties, IPrintTaskOptionsCoreUIConfigurationPublic NotInheritable Class PrintTaskOptions Implements IPrintTaskOptions, IPrintTaskOptionsCore, IPrintTaskOptionsCoreProperties, IPrintTaskOptionsCoreUIConfiguration// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
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.
Here is a JavaScript code snippet that you could use, for example, to set the printed output to color, and also to set the size of the media on which it can be printed:
// Set output to color
printTaskOptions.colorMode = colorMode;
// Set the media size for printing
printTaskOptions.mediaSize = mediaSize;
For more information about the allowed values for these print task options see PrintColorMode and PrintMediaSize.
Properties
Binding Binding Binding Binding
Gets or sets the binding option for the print task.
public : PrintBinding Binding { get; set; }public PrintBinding Binding { get; set; }Public ReadWrite Property Binding As PrintBinding// You can use this property in JavaScript.
The binding option.
Bordering Bordering Bordering Bordering
Gets or sets the bordering option for the print task.
public : PrintBordering Bordering { get; set; }public PrintBordering Bordering { get; set; }Public ReadWrite Property Bordering As PrintBordering// You can use this property in JavaScript.
The bordering option.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
Collation Collation Collation Collation
Gets or sets the collation option of the print tasks.
public : PrintCollation Collation { get; set; }public PrintCollation Collation { get; set; }Public ReadWrite Property Collation As PrintCollation// You can use this property in JavaScript.
The collation option.
ColorMode ColorMode ColorMode ColorMode
Gets or sets the color mode option of the print task.
public : PrintColorMode ColorMode { get; set; }public PrintColorMode ColorMode { get; set; }Public ReadWrite Property ColorMode As PrintColorMode// You can use this property in JavaScript.
The color mode option.
DisplayedOptions DisplayedOptions DisplayedOptions DisplayedOptions
Gets the list of options displayed for the print experience.
public : IVector<string> DisplayedOptions { get; }public IList<string> DisplayedOptions { get; }Public ReadOnly Property DisplayedOptions As IList<string>// You can use this property in JavaScript.
- Value
- IVector<PlatForm::String> IList<string> IList<string> IList<string>
The list of displayed options.
Duplex Duplex Duplex Duplex
Gets or sets the duplex option of the print task.
public : PrintDuplex Duplex { get; set; }public PrintDuplex Duplex { get; set; }Public ReadWrite Property Duplex As PrintDuplex// You can use this property in JavaScript.
The duplex option.
HolePunch HolePunch HolePunch HolePunch
Gets or sets the hole punch option of the print task.
public : PrintHolePunch HolePunch { get; set; }public PrintHolePunch HolePunch { get; set; }Public ReadWrite Property HolePunch As PrintHolePunch// You can use this property in JavaScript.
The hole punch option.
MaxCopies MaxCopies MaxCopies MaxCopies
Gets the maximum number of copies supported for the print task.
public : unsigned int MaxCopies { get; }public uint MaxCopies { get; }Public ReadOnly Property MaxCopies As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The maximum number of copies.
MediaSize MediaSize MediaSize MediaSize
Gets or sets the media size option of the print task.
public : PrintMediaSize MediaSize { get; set; }public PrintMediaSize MediaSize { get; set; }Public ReadWrite Property MediaSize As PrintMediaSize// You can use this property in JavaScript.
The media size option.
MediaType MediaType MediaType MediaType
Gets or sets the media type option for the print task.
public : PrintMediaType MediaType { get; set; }public PrintMediaType MediaType { get; set; }Public ReadWrite Property MediaType As PrintMediaType// You can use this property in JavaScript.
The media type option.
MinCopies MinCopies MinCopies MinCopies
Gets the minimum number of copies allowed for the print task.
public : unsigned int MinCopies { get; }public uint MinCopies { get; }Public ReadOnly Property MinCopies As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The minimum number of copies.
NumberOfCopies NumberOfCopies NumberOfCopies NumberOfCopies
Gets or sets the value for the number of copies for the print task.
public : unsigned int NumberOfCopies { get; set; }public uint NumberOfCopies { get; set; }Public ReadWrite Property NumberOfCopies As uint// You can use this property in JavaScript.
- Value
- unsigned int uint uint uint
The value for the number of copies.
Orientation Orientation Orientation Orientation
Gets or sets the orientation option for the print task.
public : PrintOrientation Orientation { get; set; }public PrintOrientation Orientation { get; set; }Public ReadWrite Property Orientation As PrintOrientation// You can use this property in JavaScript.
The orientation for the print task.
PrintQuality PrintQuality PrintQuality PrintQuality
Gets or sets the print quality option for the print task.
public : PrintQuality PrintQuality { get; set; }public PrintQuality PrintQuality { get; set; }Public ReadWrite Property PrintQuality As PrintQuality// You can use this property in JavaScript.
The print quality for the print task.
Methods
GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32)
Retrieves the physical dimensions of the printed page.
public : PrintPageDescription GetPageDescription(unsigned int jobPageNumber)public PrintPageDescription GetPageDescription(UInt32 jobPageNumber)Public Function GetPageDescription(jobPageNumber As UInt32) As PrintPageDescription// You can use this method in JavaScript.
- jobPageNumber
- unsigned int UInt32 UInt32 UInt32
The page number.
The page description data.
GetPagePrintTicket(PrintPageInfo) GetPagePrintTicket(PrintPageInfo) GetPagePrintTicket(PrintPageInfo) GetPagePrintTicket(PrintPageInfo)
Retrieves the physical dimensions and formatting data of a printed page.
public : IRandomAccessStream GetPagePrintTicket(PrintPageInfo printPageInfo)public IRandomAccessStream GetPagePrintTicket(PrintPageInfo printPageInfo)Public Function GetPagePrintTicket(printPageInfo As PrintPageInfo) As IRandomAccessStream// You can use this method in JavaScript.
- printPageInfo
- PrintPageInfo PrintPageInfo PrintPageInfo PrintPageInfo
The formatting data for a given print section.
The print ticket data for the given page(s), to be sent down the print pipeline.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|