Google Chrome 扩展程序:静默打印页面 [英] Google Chrome Extension: Print the page silently
问题描述
我正在开发一个内部 Google Chrome 扩展程序,需要一种方法来启动将当前页面打印到打印机.我不希望出现默认的打印对话框(因此,javascript:window.print() 是不可能的).
I'm developing an internal Google Chrome Extension that needs a way to initiate print the current page to the printer. I do not want the default Print dialog to come up (so, javascript:window.print() is out of question).
据我所知,仅使用 JS + HTML 插件是不可能的,所以我也愿意使用 NPAPI 插件(使用虚拟 mime 类型).而且我只关心 Windows 平台.
As far as I understand, this is not possible just with the JS + HTML plug-in, so I'm also open to using the NPAPI plugin also (with a dummy mime-type). And I'm concerned for Windows platform only.
如果可能,我也愿意接受各种黑客/解决方法,尽管标准解决方案会很好.
I'm also open for various hacks / workarounds if possible, though a standard solution would be nice.
如果您认为这是不可能的,请告诉我您是否知道为此记录了任何功能请求?
If you think this is not possible, let me know if you know any feature request logged for it?
欢迎提出任何建议/澄清..
Any suggestions/clarifications are welcome..
推荐答案
在 chrome (v18+) 中,我们有 --kiosk --kiosk-printing
开关.可以自动打印到默认打印机,无需打印确认.
In chrome (v18+) we have the --kiosk --kiosk-printing
switches. One can print automatically to default printer without print confirmation.
您可以从这个视频中看到它http://www.youtube.com/watch?v=D6UHjuvI7IE
You can see it from this video http://www.youtube.com/watch?v=D6UHjuvI7IE
这篇关于Google Chrome 扩展程序:静默打印页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!