Search code examples
printinguwpwindows-store-apps

Print raw data in UWP


I'm developing an app in UWP. I need to send to my printer a RAW string (or file) and get that printed. I succed in using the old RawPrinterHelper from here.

I have some problems verifiyng the app using the Windows App Certification Kit. I get errors like this one :

API ClosePrinter in winspool.drv is not supported for this application type. MyApp.dll calls this API.

I think that DllImport() in RawPrinterHelper is wrong.

Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way?

P.S. I need to publish the app on the Microsoft Store.


Solution

  • If you have already run the WACK test with the release build, then as the error described there are APIs not supported for the windows store app. More details please reference Supported API test.

    Is there a way to use a diffent RawPrinterHelper or bypass the Windows App Certification Kit in some way

    For print relative features in windows store app, please follow this tutorial and the official sample. This provide alternatives to the windows print relative APIs. Details please reference Printing and documents section of Alternatives to Windows APIs in Universal Windows Platform (UWP) apps.

    If you want the print feature with no print dialog you may reference this thread.