Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to print a document in windows service via c#?

I want to print a PDF document . I am developing the same in Windows Service via C#. I want inbuilt dlls & if not (free third party dlls) to do the same. Also want to configure the printer settings in App.Config.

What I have tried:

I want to print a PDF document . I am developing the same in Windows Service via C#. I want inbuilt dlls & if not (free third party dlls) to do the same. Also want to configure the printer settings in App.Config.
Posted
Updated 12-Jun-16 21:58pm
v2

1 solution

Maybe you can adapt the code in this tip to suit your needs.

How to Silently Print PDFs using Adobe Reader and C#[^]

It will probably not work if you plan to use it on a server, though, as it is using Acrobat Reader for the printing.

You could also try Redmon together with Ghostscript.
With Redmon you can create a virtual printer port, redirect the printer output to your own software, mess with it and then send it to the real printer or another software.
Ghostscript can be used to translate PDF into printer language.

This is an old article that describes just that:
PDF Writer[^]
If you have problems to create a port on your computer look in the comment section for the article.

I have to admit I haven't tried this approach myself.
 
Share this answer
 
v3
Comments
Alex14678 13-Jun-16 23:53pm    
I want to print the pdf document even if Adobe software are not installed. Is there any such code that suits the mentioned requirement?
George Jonsson 14-Jun-16 1:51am    
See my updated answer. The article I have linked to might be of help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900