PrintTaskOptionDetails
PrintTaskOptionDetails
PrintTaskOptionDetails
PrintTaskOptionDetails
Class
Definition
A collection of events, methods and properties for advanced print tasks.
public : sealed class PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration, IPrintTaskOptionDetailspublic sealed class PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration, IPrintTaskOptionDetailsPublic NotInheritable Class PrintTaskOptionDetails Implements IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration, IPrintTaskOptionDetails// 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
You can use PrintTaskOptionDetails to retrieve information about the available options for a print task and to add custom options to the print experience. If you develop in JavaScript, however, you must use Direct2D printing to change the preview or print content based on option changes. This is because print template is not supported. For more information about Direct2D printing, see Printing and command lists.
Here is a JavaScript code snippet that shows how to retrieve the advanced options for a print task and then set the order in which they will be displayed in the print window of the app.
// Retrieve the advanced Print Task Options
var printDetailedOptions =
Windows.Graphics.Printing.OptionDetails.PrintTaskOptionDetails.getFromPrintTaskOptions(printTask.options);
// Choose the printer options to be shown.
// The order in which the options are appended determines the order in which they appear in the UI
printDetailedOptions.displayedOptions.clear();
printDetailedOptions.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.copies);
printDetailedOptions.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.orientation);
printDetailedOptions.displayedOptions.append(Windows.Graphics.Printing.StandardPrintTaskOptions.colorMode);
For more information on this and other printing scenarios, see Printing on the Windows Dev Center.
Properties
DisplayedOptions DisplayedOptions DisplayedOptions DisplayedOptions
Gets the list of print task options that are currently displayed.
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>
A pointer to the list of options.
Options Options Options Options
Gets the list of options for the advanced print task.
public : IMapView<string, IPrintOptionDetails> Options { get; }public IReadOnlyDictionary<string, IPrintOptionDetails> Options { get; }Public ReadOnly Property Options As IReadOnlyDictionary<string, IPrintOptionDetails>// You can use this property in JavaScript.
- Value
- IMapView<PlatForm::String, IPrintOptionDetails> IReadOnlyDictionary<string, IPrintOptionDetails> IReadOnlyDictionary<string, IPrintOptionDetails> IReadOnlyDictionary<string, IPrintOptionDetails>
The list of options for the advanced print task.
Methods
CreateItemListOption(String, String) CreateItemListOption(String, String) CreateItemListOption(String, String) CreateItemListOption(String, String)
Creates a custom list of items that allow the user to choose the page format.
public : PrintCustomItemListOptionDetails CreateItemListOption(PlatForm::String optionId, PlatForm::String displayName)public PrintCustomItemListOptionDetails CreateItemListOption(String optionId, String displayName)Public Function CreateItemListOption(optionId As String, displayName As String) As PrintCustomItemListOptionDetails// You can use this method in JavaScript.
- optionId
- PlatForm::String String String String
The ID for the custom item.
- displayName
- PlatForm::String String String String
The display name for the custom item.
CreateTextOption(String, String) CreateTextOption(String, String) CreateTextOption(String, String) CreateTextOption(String, String)
Creates a CustomPrintTaskOptionText object to handle the display name and other parameters of the advanced print task option item.
public : PrintCustomTextOptionDetails CreateTextOption(PlatForm::String optionId, PlatForm::String displayName)public PrintCustomTextOptionDetails CreateTextOption(String optionId, String displayName)Public Function CreateTextOption(optionId As String, displayName As String) As PrintCustomTextOptionDetails// You can use this method in JavaScript.
- optionId
- PlatForm::String String String String
The ID of the print task option.
- displayName
- PlatForm::String String String String
The display name of the print task option.
The CustomPrintTaskOptionText object.
GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions)
Used to retrieve the available options for a print task.
public : static PrintTaskOptionDetails GetFromPrintTaskOptions(PrintTaskOptions printTaskOptions)public static PrintTaskOptionDetails GetFromPrintTaskOptions(PrintTaskOptions printTaskOptions)Public Static Function GetFromPrintTaskOptions(printTaskOptions As PrintTaskOptions) As PrintTaskOptionDetails// You can use this method in JavaScript.
- printTaskOptions
- PrintTaskOptions PrintTaskOptions PrintTaskOptions PrintTaskOptions
Pointer to a PrintTaskOptions object.
Pointer to a PrintTaskOptionDetails object.
- See Also
GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32)
Returns a PrintPageDescription object for the referenced page number.
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 PrintPageDescription object.
Events
BeginValidation BeginValidation BeginValidation BeginValidation
Raised when the print system begins a validation pass on the current state of the print ticket.
public : event TypedEventHandler BeginValidation<PrintTaskOptionDetails, object>public event TypedEventHandler BeginValidation<PrintTaskOptionDetails, object>Public Event BeginValidation<PrintTaskOptionDetails, object>// You can use this event in JavaScript.
OptionChanged OptionChanged OptionChanged OptionChanged
Raised when any one of the advanced print task options is changed.
public : event TypedEventHandler OptionChanged<PrintTaskOptionDetails, PrintTaskOptionChangedEventArgs>public event TypedEventHandler OptionChanged<PrintTaskOptionDetails, PrintTaskOptionChangedEventArgs>Public Event OptionChanged<PrintTaskOptionDetails, PrintTaskOptionChangedEventArgs>// You can use this event in JavaScript.