views:

131

answers:

2

I have a need to print out multiple PDFs with the help of javascript. Is this even possible without rendering each PDF in a separate window and calling window.print()?

Basically, I would like to be able to do something like print('my_pdf_url').

Edit After some searching, I have come to the conclusion that there are no other methods than the one I've described above. It is a far from perfect solution, but it works in simple cases.

Edit I ended up merging the PDFs to a monster PDF on the server side and then send this single PDF to the user, who can then choose to print it out.

A: 

printing pdf with javascript is not possible. u can try java.awt.print class for pdf printing.

Shelly
+1  A: 

"When it comes to web pages on the internet there is absolutely no way that you can set up a Javascript command to send directly to the default printer."

If you are looking at an intranet/local network vs. internet: "The Internet Explorer substitute for Javascript (called JScript) therefore has slightly more information about the browser and operating system that Javascript itself does. The individual computers on the network running the intranet may be able to be configured to allow the JScript window.print() command write directly to the printer without displaying the print dialog. This configuration would need to be set up individually on each client computer"

http://javascript.about.com/od/events/a/print_3.htm

jasonk
I was not looking to print to the default printer without displaying the print dialog. Rather, I would like to use a single print dialog for all the pages. But thanks for an informative answer.
Daniel Abrahamsson