简体   繁体   English

如何从HTML5页面打印

[英]How to print from HTML5 Pages

I am working on site, that need to print to the default printer(Would be nice if can pick via code from the installed printer) from an HTML5 Page. 我在现场工作,需要从HTML5页面打印到默认打印机(如果可以通过安装的打印机中的代码进行选择,那将是一个很好的选择)。

Not only that, preferably i want the printing to be silent printing(NO selection or dialog boxes) 不仅如此,最好我希望打印为无声打印(无选择或对话框)

The application/website is used in the warehouse, and need to do lots of Label printing and shipping label printing. 该应用程序/网站在仓库中使用,需要做很多标签打印和运输标签打印。

I am thinking about using click Once application just for the printing part, but not sure if they have full access to the system. 我正在考虑仅将“单击一次”应用程序用于打印部件,但不确定它们是否具有对系统的完全访问权限。

Should be cross browser compatible. 应该与跨浏览器兼容。

What are my options, links to working example would be helpful. 我有什么选择,链接到工作示例将很有帮助。

There's almost no way to do it, short of a IE browser extension, that's going to avoid the print dialog, if your goal is to go from server -> browser -> printer. 如果您的目标是从服务器->浏览器->打印机进入,则几乎没有办法做到这一点,除了IE浏览器扩展之外,这将避免出现打印对话框。

However, if you have a network printer, and you're willing to go server -> printer, then it is possible. 但是,如果您有一台网络打印机,并且愿意转到服务器->打印机,则有可能。

I wrote up a few different solutions here: http://forum.print-dev.com/discussion/9/printing-directly-from-rails-app-to-printer#latest 我在这里写了一些不同的解决方案: http : //forum.print-dev.com/discussion/9/printing-direct-from-rails-app-to-printer#latest

Of those three (print by email, print by network protocol, print by google cloudprint), I find print by email to be the easiest by far to implement, because sending an email is pretty straightforward in most languages. 在这三种方式中(通过电子邮件进行打印,通过网络协议进行打印,通过Google cloudprint进行打印),我发现到目前为止,通过电子邮件进行打印是最容易实现的,因为在大多数语言中发送电子邮件都是非常简单的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM