With C#, how can I print a PDF document (without any dialog boxes in the background) to an indicated printer?
问题:
回答1:
I have used the following PDF library in the past to perform batch printing of PDF documents from a C# Windows Service.
http://www.quickpdflibrary.com/
It's a pretty decent library and if I remember correctly it only took a few lines of code to print the document. It worked very well and saved me a consider amount of time.
Also, the recommended link that discusses using DDE to launch a desktop application on a server to perform the printing is a bad idea. Adobe Reader probably doesn't support this and since it is a desktop application running in a windowless session you may run into problems with message boxes and dialog boxes. That solution just doesn't scale in my humble opinion.
回答2:
here we go
回答3:
Disclaimer: I work for Atalasoft
If you don't want to depend on Acrobat being on the server, you need to rasterize the PDF pages yourself and send them to the printer using the normal .NET printing API. We have a product that can rasterize PDF that uses the Foxit engine underneath. It deploys as a normal .NET assembly and doesn't require any other software to be installed.