Skip to main content
PrintTaskConfiguration class

Applies to Windows only

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

Syntax


/* For information about creating or accessing this object, see Remarks. */

public sealed class PrintTaskConfiguration

Public NotInheritable Class PrintTaskConfiguration

public ref class PrintTaskConfiguration sealed 

Attributes

[ Version(0x06020000)]

Members

The PrintTaskConfiguration class has these types of members:

Events

The PrintTaskConfiguration class has these events.

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

 

Properties

The PrintTaskConfiguration class has these properties.

PropertyAccess typeDescription

PrinterExtensionContext

Read-onlyGets the context for the print task extension.

 

Remarks

When a Windows Store 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, detail.configuration, for controlling the printer. This property provides an object of type Windows.Devices.Printers.Extensions.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 properties.


var configuration;
var printerExtesionContext;
	
function displayPrintSettings() {

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

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

    var feature = "PageOrientation";

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

    // 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, 
        "DisplayName"),

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

    // logic to display the orientation string here
}

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

Windows.Devices.Printers.Extensions
Windows::Devices::Printers::Extensions [C++]

Metadata

Windows.winmd

See also

PrinterExtensionContext