3
votes

I want to create a method in web application ASP.Net + C# to take as input parameters PDF file paths, then print all of it without showing Selection printer dialog, so it prints using default printer.

2
Do the PDF files reside on the client machine or on the server? By "method in web application" do you mean a method executed on the client machine or on the server? Is the printer connected to the client machine or to the server? - Rune
PDF is in server side and printer connected to client machine - Mohammed Thabet

2 Answers

3
votes

The best you can do is concatenate the PDF files into one file and then print it, showing the printer dialog once at the beginning of the process. There are many commercial .NET PDF libraries that have this functionality.

Disclaimer: I work at Atalasoft. Here the code for doing it with DotImage

PdfDocument.Combine("Output.pdf", "doc1.pdf", "doc2.pdf", "doc3.pdf");

http://www.atalasoft.com/products/dotimage/white-papers/building-pdf-documents-with-dotimage

1
votes

A web application cannot silently print to a client's printer. This will be a violation of the browser security model. Browsers and PDF browser plugins have to show a dialog box and prompt the user to allow printing.