WinRT - 打印应用程序

时间:2013-11-12 11:43:07

标签: printing windows-runtime winrt-xaml windows-8.1

我们如何让RT应用程序注册Print

PrintManager.ShowPrintUIAsync();

这将指示初始化打印小饰物,但我需要检查该应用程序是否注册了打印。

任何想法?

    protected void RegisterForPrinting()
    {
        PrintManager printMan = PrintManager.GetForCurrentView();
        if(printMan == null)
            return;
        // Create the PrintDocument.
        printDocument = new PrintDocument();

        // Save the DocumentSource.
        printDocumentSource = printDocument.DocumentSource;

        // Add an event handler which creates preview pages.
        printDocument.Paginate += CreatePrintPreviewPages;

        // Add an event handler which provides a specified preview page.
        printDocument.GetPreviewPage += GetPrintPreviewPage;

        // Add an event handler which provides all final print pages.
        printDocument.AddPages += AddPrintPages;

        // Create a PrintManager and add a handler for printing initialization.

        printMan.PrintTaskRequested += PrintTaskRequested;

        // Initialize print content for this scenario
        //PreparePrintContent();
    }

0 个答案:

没有答案