PHP-如何在网页中打开pdf文件时打开打印窗口?
问题描述:
我使用FPDF生成pdf文件并在新窗口中打开.
I use FPDF to generate a pdf file and open it in a new window.
在新窗口中打开打印窗口时如何弹出?
how to pop up the print window when it is opened in a new window?
答
如果您正在处理网页,则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.