Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print a PDF from the browser

In a Web application, is it possible to force a PDF file to be printed on the client? If the browser is configured to open the PDF inside the window, I guess that calling window.print() will work, but some browsers (like mine) are configured to open the PDF externally.

like image 859
Antoine Aubry Avatar asked Oct 15 '08 15:10

Antoine Aubry


1 Answers

The way google docs does it is by embedding JavaScript into the PDF that tells Acrobat Reader or any other compliant reader to print it.

You would need a PDF toolkit to do this with a random PDF.

like image 133
Lou Franco Avatar answered Sep 19 '22 12:09

Lou Franco