使用 PHP 打印图像
不幸的是,由于 print() 函数的存在,在 Google 上搜索此内容非常困难。我有一个表单,可以发布到一个页面,该页面根据提交的值创建图像。我需要这样做,以便在创建图像后打开打印对话框。
应该很简单,但是太晚了而且我很懒-_-
Unfortunately searching this on Google is very difficult due to the print() function. I have a form that posts to a page that creates an image based on the submitted values. I need to make it so that after creating the image it opens the print dialogue.
Should be simple enough, but it's late and I'm lazy -_-
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PHP 本身无法做到这一点,毕竟它是一种服务器端语言,而您要求做的是客户端功能。
也许 Javascript 的 window.print() 方法 就是您所追求的?
PHP itself can't do this, afterall it is a server side language and what you're asking to do is client side functionality.
Perhaps Javascript's window.print() method is what you are after?
我想说的是,在它创建图像之后,它应该有一个 javascript 函数来打开打印对话框。像这样的东西:
I would say after it creates the image it should have a javascript function to open the print dialogue. Something like: