PrintTaskOptionDetails PrintTaskOptionDetails PrintTaskOptionDetails PrintTaskOptionDetails PrintTaskOptionDetails Class

Definition

A collection of events, methods and properties for advanced print tasks.

public : sealed class PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration
struct winrt::Windows::Graphics::Printing::OptionDetails::PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration
public sealed class PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration
Public NotInheritable Class PrintTaskOptionDetails Implements IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

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.

Version history

Windows version SDK version Value added
1803 17134 CreateToggleOption

Properties

DisplayedOptions DisplayedOptions DisplayedOptions DisplayedOptions DisplayedOptions

Gets the list of print task options that are currently displayed.

Options Options Options Options Options

Gets the list of options for the advanced print task.

Methods

CreateItemListOption(String, String) 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.

CreateTextOption(String, String) 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.

CreateToggleOption(String, String) CreateToggleOption(String, String) CreateToggleOption(String, String) CreateToggleOption(String, String) CreateToggleOption(String, String)

Creates a PrintCustomToggleOptionDetails object to handle the display name and other parameters of the advanced print task option item.

GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions) GetFromPrintTaskOptions(PrintTaskOptions)

Used to retrieve the available options for a print task.

GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32) GetPageDescription(UInt32)

Returns a PrintPageDescription object for the referenced page number.

Events

BeginValidation BeginValidation BeginValidation BeginValidation BeginValidation

Raised when the print system begins a validation pass on the current state of the print ticket.

OptionChanged OptionChanged OptionChanged OptionChanged OptionChanged

Raised when any one of the advanced print task options is changed.

See also