WinJS Windows应用程序 - 当我打印页面时,有没有办法指定打印机?

时间:2015-05-28 15:18:04

标签: windows printing windows-store-apps winjs

要打印我的页面,我有类似的东西:

function onPrintTaskRequested(printEvent) {
    var printTask = printEvent.request.createPrintTask("Print Page", function (args) {

        // Get the print document source
        var src = MSApp.getHtmlPrintDocumentSource(document);
        args.setSource(src); 

        // Register the handler for print task completion event
        printTask.oncompleted = onPrintTaskCompleted;
    });
}

我想为用户指定打印机不需要选择打印机并自动打印。我能这样做吗?

1 个答案:

答案 0 :(得分:1)

没有。用户始终参与直接Windows应用商店应用中的打印工作流程。该应用可以offer the print UI,它可以suggest default general settings,但如果没有用户的确认,它就无法选择特定的打印机或打印。

如果您有侧载应用程序(例如,在自助服务终端中),则可以在代理组件的桌面端创建Brokered Windows Runtime Component并使用桌面打印API。