且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP-如何在网页中打开pdf文件时打开打印窗口?

更新时间:2023-12-06 15:36:16

如果您正在处理网页,则Zombat的答案有效,但PDF文件没有正文标签.对于PDF文件,我不确定是否可以.

Zombat's answer works if you're dealing with a web page, but a PDF file has no body tag. With a PDF file I'm not sure it's possible.

但是!我认为这样还是更好.与假定用户要打印并有帮助"地为他们抛出对话框相比,使用户按ctrl-p进行打印具有较小的侵入性.当然是国际海事组织.

BUT! I would argue that it's better this way anyway. Making the user hit ctrl-p to print is less invasive than assuming they want to print and "helpfully" throwing up the dialog for them. IMO of course.