Share via


PrintTaskConfiguration 클래스

정의

클라이언트가 인쇄 작업 확장 컨텍스트를 검색하고 인쇄 작업에 이벤트 처리기를 추가할 수도 있습니다.

public ref class PrintTaskConfiguration sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Printers.Extensions.ExtensionsContract, 65536)]
class PrintTaskConfiguration final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Printers.Extensions.ExtensionsContract), 65536)]
public sealed class PrintTaskConfiguration
Public NotInheritable Class PrintTaskConfiguration
상속
Object Platform::Object IInspectable PrintTaskConfiguration
특성

Windows 요구 사항

디바이스 패밀리
Windows Desktop Extension SDK (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Devices.Printers.Extensions.ExtensionsContract (v1.0에서 도입되었습니다.)

설명

인쇄 창의 기타 설정에서 UWP 앱을 호출하면 활성화 이벤트는 프린터를 제어하기 위한 속성 Configuration을 노출하는 Windows.UI.WebUI.WebUIPrintTaskSettingsActivatedEventArgs 형식의 이벤트 인수를 제공합니다. 이 속성은 인쇄 작업 확장 컨텍스트에 대한 액세스를 제공하는 PrintTaskConfiguration 형식의 개체를 제공하며, 인쇄 티켓을 업데이트하는 이벤트 처리기를 추가할 수도 있습니다.

다음 JavaScript 코드 조각은 PrintTaskConfiguration 개체에 액세스한 다음 이를 사용하여 PrinterExtensionContext 속성에 액세스하는 방법을 보여 줍니다.

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
}

속성

PrinterExtensionContext

인쇄 작업 확장의 컨텍스트를 가져옵니다.

이벤트

SaveRequested

앱이 인쇄 티켓을 업데이트해야 한다고 디바이스 앱에 알리기 위해 인쇄 창에서 발생합니다.

적용 대상

추가 정보