Sumatra PDF was the answer for me regarding how to print PDF files from an application. One scenario is when a cloud service such as Fedex or UPS shipping returns the results of the request, including binary image of the shipping label as PDF file. The application then needs to print it out on a physical printer, but using Adobe Reader meets artificial and completely unnecessary difficulties created by Adobe in the name of security, discussed here. Since it appears that there are quite a number of developers facing this problem (and creating ugly workarounds such as invoking Adobe Reader, and then forcefully killing the process after hardcoded timeout), I wonder if the idea of creating an assembly published at Nuget was ever entertained. I was able to create such an assembly for my own application in 15 minutes, but it runs an external sumatrapdf.exe, while it probably would be more efficient to reuse the code thus making a “native” dll.
If this is of interest, I would be happy to help with what I can, but I’m not familiar with C++.
Home / How about a Nuget assembly?
vrapp
kjk
If you want to pursuit such a project, you should probably skip Sumatra and write a C# (I assume, since you’re talking about nuget) wrapper around mupdf and add a bit of Windows printing code.
Sumatra uses mupdf internally.
The issue would be licensing: mupdf (and Sumatra) is published under GPLv3 so technically you can’t ship it with your app unless it’s also published under GPLv3. You can buy a license for mupdf but it would probably cost more than you’re willing to spend for just printing component.