Is there a way to print PDF from UWP application? Other than rendering it as png
or BitmapImage
.
I had look at Microsoft printing sample and pdf rendering sample to achieve printing pdf by rendering it into bitmapimage. But, it looses the quality of the pdf. Would like to know if any other efficient method available without using libraries .
I tried to find direct solutions from Microsoft without using libraries. But, there isn't any so i used PDfSharp
to solve my problem with the help of AppServiceBridge
by Microsoft. I have used AppService bridge because PdfSharp isn't directly available for WinRT.
I used a virtual printer in C# using the Github project: Microsoft/Windows-driver-samples/print/XPSDrvSmpl.
https://github.com/Microsoft/Windows-driver-samples/tree/master/print/XPSDrvSmpl
Installer: http://wixtoolset.org/
Application: Listen to internal port
Flow: Install printer and application from a single installer. User prints something with your driver while the application listens to the internal port. When data is sent the application picks it up. This is for XPS, can be converted to PDF, but the flow is similar no matter what you are printing.
Original answer:
https://stackoverflow.com/a/40370083/3850405
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With