Print PDF using the Windows service

C #, how can I print a PDF document (without any dialog boxes in the background) to the specified printer?

+4
source share
3 answers

In the past, I used the following PDF library to batch print PDF documents from a C # Windows service.

http://www.quickpdflibrary.com/

This is a pretty decent library, and if I remember correctly, it took just a few lines of code to print a document. It worked very well and saved me from time.

Also, a recommended link that discusses using DDE to run a desktop application on a server to print is a bad idea. Adobe Reader probably does not support this, and since it is a desktop application running in a windowless session, you may run into problems with messages and dialog boxes. This solution just does not scale in my humble opinion.

+4
source
+1
source

Disclaimer: I work for Atalasoft

If you do not want to depend on the presence of Acrobat on the server, you need to rasterize the PDF pages yourself and send them to the printer using the standard .NET printing API. We have a product that can rasterize a PDF that uses the Foxit engine. It is deployed as a normal .NET assembly and does not require any other software installation.

0
source

Source: https://habr.com/ru/post/1286340/


All Articles