How to send a PDF file directly to the printer using JavaScript?
I found two answers in a forum:
I think this Library of JavaScript might Help you:
It's called Print.js
First Include
It's basic usage is to call printJS()
and just pass in a PDF document url: printJS('docs/PrintJS.pdf')
What I did was something like this, this will also show "Loading...." if PDF document is too large.
However keep in mind that:
Firefox currently doesn't allow printing PDF documents using iframes. There is an open bug in Mozilla's website about this. When using Firefox, Print.js will open the PDF file into a new tab.