PHP-如何在网页中打开pdf文件时打开打印窗口? [英] php - how to open print window while a pdf file is opened in web page?

查看:162
本文介绍了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.

这篇关于PHP-如何在网页中打开pdf文件时打开打印窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆