PrintTaskConfiguration PrintTaskConfiguration PrintTaskConfiguration PrintTaskConfiguration PrintTaskConfiguration Class


Allows a client to retrieve the print task extension context, and also to add an event handler to the print task.

public : sealed class PrintTaskConfiguration : IPrintTaskConfiguration
struct winrt::Windows::Devices::Printers::Extensions::PrintTaskConfiguration : IPrintTaskConfiguration
public sealed class PrintTaskConfiguration : IPrintTaskConfiguration
Public NotInheritable Class PrintTaskConfiguration Implements IPrintTaskConfiguration
// This class does not provide a public constructor.
Windows 10 requirements
Device family
Windows Desktop Extension SDK (introduced v10.0.10240.0)
API contract
Windows.Devices.Printers.Extensions.ExtensionsContract (introduced v1)


When a UWP app is invoked from More settings in the print window, the activation event provides an event argument of type Windows.UI.WebUI.WebUIPrintTaskSettingsActivatedEventArgs that exposes a property, Configuration, for controlling the printer. This property provides an object of type PrintTaskConfiguration that provides access to the print task extension context, and also allows you to add an event handler to update the print ticket.

The following JavaScript code snippet demonstrates how to access the PrintTaskConfiguration object, and then use that to access the PrinterExtensionContext property.

var configuration;
var printerExtesionContext;

function displayPrintSettings() {

    if (!configuration) {
        sdkSample.displayError("Configuration argument is null");

    printerExtesionContext = configuration.printerExtensionContext;
    printHelper = new Microsoft.Samples.Printing.WwaDca.

    var feature = "PageOrientation";

    // if printer's capabilities include this feature.
    if (!printHelper.featureExists(feature)) {

    // Get the selected option for this feature in the current
    // context's print ticket.
    var selectedOption = printHelper.getSelectedOptionIndex(feature);

    // Get the array of options in the current context’s print ticket
    var optionIndex = printHelper.getOptionInfo(feature, "Index"),
    var optionNames = printHelper.getOptionInfo(feature, 

    var selectedName;
    for (var i = 0; i < optionIndex.length; i++) {
        if (optionIndex[i] === selectedOption)
           selectedName = optionNames[i];

    // logic to display the orientation string here


PrinterExtensionContext PrinterExtensionContext PrinterExtensionContext PrinterExtensionContext PrinterExtensionContext

Gets the context for the print task extension.


SaveRequested SaveRequested SaveRequested SaveRequested SaveRequested

Raised by the print window for your app to notify the device app that the print ticket must be updated.

See Also