开发者

Autoprint PDF script on php or javascript

I want to build a page that will automatically print a pdf d开发者_如何学Cocument. For example I can call mypage.html?doc=my.pdf and it will print my.pdf file.

How I can do it using javascript or php?

Vladimir


The closest you can get to what you want is to embed an iframe containing the PDF in an HTML page, then call window.print when the iframe has loaded.

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

This will open the standard print dialog on most browsers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜