I'm developing a backend application using C# and I need to do a very simple thing: to print an existing PDF file using the default printer when the application receives some HTTP request. I don't need any "printer choose" window or anything else, because the application runs on server and only responds to HTTP requests. I just need to silently print a PDF file when my backend receives a request to some URL. I've been looking on the internet for a couple of hours, found classes like PrintDocument
and PdfDocument
, but I couldn't understand how to use them.
Asked
Active
Viewed 1,445 times
1

Salivan
- 1,876
- 7
- 26
- 45
-
I think it's best to try and ask questions pertaining to how to use PrintDocument instead. When you say couldn't figure it out you may want to post questions regarding that. I think that is a pretty standard way of printing in c# – Chris Hawkes Feb 10 '16 at 19:07
-
I guess `PrintDocument` is for Windows Forms only, but I'm using a different framework `NancyFX`. – Salivan Feb 10 '16 at 19:09
-
Try this? http://stackoverflow.com/questions/419412/print-html-document-from-windows-service-without-print-dialog – Patrick Goode Feb 10 '16 at 19:12
-
Hey, You can try this answer. https://stackoverflow.com/questions/47857500/c-sharp-how-to-programmatically-print-an-existing-pdf-file-using-printdocument – Swagat Swain Jan 31 '18 at 08:07