PrintTaskOptionDetails PrintTaskOptionDetails PrintTaskOptionDetails PrintTaskOptionDetails Class

Definition

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

public : sealed class PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration, IPrintTaskOptionDetails
public sealed class PrintTaskOptionDetails : IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration, IPrintTaskOptionDetails
Public NotInheritable Class PrintTaskOptionDetails Implements IPrintTaskOptionsCore, IPrintTaskOptionsCoreUIConfiguration, IPrintTaskOptionDetails
// 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.

Properties

DisplayedOptions DisplayedOptions DisplayedOptions DisplayedOptions

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

public : IVector<Platform::String> DisplayedOptions { get; }
public IList<string> DisplayedOptions { get; }
Public ReadOnly Property DisplayedOptions As IList<string>
var iList = printTaskOptionDetails.displayedOptions;
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<Platform::String, IPrintOptionDetails> Options { get; }
public IReadOnlyDictionary<string, IPrintOptionDetails> Options { get; }
Public ReadOnly Property Options As IReadOnlyDictionary<string, IPrintOptionDetails>
var iReadOnlyDictionary = printTaskOptionDetails.options;
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
var printCustomItemListOptionDetails = printTaskOptionDetails.createItemListOption(optionId, displayName);
Parameters
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.

Returns

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
var printCustomTextOptionDetails = printTaskOptionDetails.createTextOption(optionId, displayName);
Parameters
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.

Returns

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
var printTaskOptionDetails = Windows.Graphics.Printing.OptionDetails.PrintTaskOptionDetails.getFromPrintTaskOptions(printTaskOptions);
Parameters
printTaskOptions
PrintTaskOptions PrintTaskOptions PrintTaskOptions PrintTaskOptions

Pointer to a PrintTaskOptions object.

Returns
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
var printPageDescription = printTaskOptionDetails.getPageDescription(jobPageNumber);
Parameters
jobPageNumber
unsigned int UInt32 UInt32 UInt32

The page number.

Returns

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 TypedEventHandler BeginValidation( Of ( Of PrintTaskOptionDetails ), ( Of object ))
function onBeginValidation(eventArgs){/* Your code */}


printTaskOptionDetails.addEventListener("beginValidation", onBeginValidation);
printTaskOptionDetails.removeEventListener("beginValidation", onBeginValidation);

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 TypedEventHandler OptionChanged( Of ( Of PrintTaskOptionDetails ), ( Of PrintTaskOptionChangedEventArgs ))
function onOptionChanged(eventArgs){/* Your code */}


printTaskOptionDetails.addEventListener("optionChanged", onOptionChanged);
printTaskOptionDetails.removeEventListener("optionChanged", onOptionChanged);

See Also