Auto-print PDF script in php or javascript

I want to create a page that automatically prints a PDF document. For example, can I call mypage.html? Doc = my.pdf and print the file my.pdf.

How can I do this using javascript or php?

Vladimir

+6
javascript php printing pdf
source share
1 answer

The closest thing you can do is insert the iframe containing the PDF into the HTML page, and then call window.print when the iframe loads.

 ... <iframe src="path/to/file.pdf" onload="window.print()"></iframe> ... 

This will open the standard print dialog in most browsers.

+3
source share

All Articles