如何从浏览器打印PDF [英] How to print a PDF from the browser

查看:386
本文介绍了如何从浏览器打印PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Web应用程序中,是否可以强制在客户端上打印PDF文件?如果浏览器被配置为在窗口内打开PDF,我想调用window.print()会工作,但是一些浏览器(如我的)被配置为从外部打开PDF。

google文档的做法是将JavaScript嵌入到PDF中,告诉Acrobat Reader或任何其他兼容的读者打印它。



您需要一个PDF工具包以随机PDF格式完成此工作。


In a Web application, is it possible to force a PDF file to be printed on the client? If the browser is configured to open the PDF inside the window, I guess that calling window.print() will work, but some browsers (like mine) are configured to open the PDF externally.

解决方案

The way google docs does it is by embedding JavaScript into the PDF that tells Acrobat Reader or any other compliant reader to print it.

You would need a PDF toolkit to do this with a random PDF.

这篇关于如何从浏览器打印PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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