Do I need rasterization permission to print on WinRT?

25 views
Skip to first unread message

Aaron

unread,
Mar 2, 2015, 4:53:46 PM3/2/15
to
Q:

I'm trying to print on WinRT, but it's telling me that I need rasterization permission.  Why?

A:

It sounds like you may be trying to follow some of the online code samples for Windows server/desktop printing (i.e., Example 2 of https://www.pdftron.com/pdfnet/samplecode/PDFPrintTest.cs.html).  If so, please be aware that this method will not work on WinRT.

You can see how printing on WinRT should work by following the CompleteReader sample.  It uses the PDFPrintManager class to create a Printing Contract (which is the only way to print in Windows Store Apps).

Code to register for printing would look something like this:
pdftron.PDF.PDFPrintManager _PDFPrintManager = pdftron.PDF.PDFPrintManager.GetInstance();
Windows.ApplicationModel.Resources.ResourceLoader loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView("Printing");
 
//new Windows.ApplicationModel.Resources.ResourceLoader();
_PDFPrintManager
.SetResourceLoader(loader);
// standard options
_PDFPrintManager
.AddStandardPrintOption(Windows.Graphics.Printing.StandardPrintTaskOptions.MediaSize);
_PDFPrintManager
.AddStandardPrintOption(Windows.Graphics.Printing.StandardPrintTaskOptions.Orientation);
// PDFTron options
_PDFPrintManager
.AddUserOptionAnnotations();
_PDFPrintManager
.AddUserOptionAutoRotate();
_PDFPrintManager
.AddUserOptionPageRange();
_PDFPrintManager
.RegisterForPrintingContract(pdfDoc, docTitle);


If the user then invokes printing (through the charms bar -> Devices -> Print), our PDFPrintManager will handle it, displaying a preview of the document and the options set in the code above.

Reply all
Reply to author
Forward
0 new messages