在 Chrome 浏览器上删除 NPAPI 后替代 Jzebra/QZ Java Raw Print Plugin

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27057816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 03:45:29  来源:igfitidea点击:

Alternative to Jzebra/QZ Java Raw Print Plugin after NPAPI being dropped on Chrome Browser

javajavascriptgoogle-chromeprinting

提问by anestis

We all know that NPAPI will be completely removed from Chrome in a few months.

我们都知道 NPAPI 将在几个月内从 Chrome 中完全删除。

What would be an alternative to the Jzebra/QZ Java plugin that makes raw printing (sending raw ESC/P commands) to POS printers?

什么是 Jzebra/QZ Java 插件的替代品,它使原始打印(发送原始 ESC/P 命令)到 POS 打印机?

Is there a Chrome API (HTML5 and Javascript) that will be able to replace the communication between the browser and the locally installed POS printers in USB or Ethernet?

是否有 Chrome API(HTML5 和 Javascript)可以替代浏览器与 USB 或以太网中本地安装的 POS 打印机之间的通信?

回答by tresf

Is there a Chrome API (HTML5 and Javascript) that will be able to replace the communication between the browser and the locally installed POS printers in USB or Ethernet?

是否有 Chrome API(HTML5 和 Javascript)可以替代浏览器与 USB 或以太网中本地安装的 POS 打印机之间的通信?

Update:A pure HTML5 solution exists for USB devices, but examples are currently hard to find and browser adoption has been slow:

更新:存在适用于 USB 设备的纯 HTML5 解决方案,但目前很难找到示例,并且浏览器的采用速度很慢:

  • WebUSBUSB devices only, select browsers.

In regards to HTML5 and JavaScript, since the removal of NPAPI, the solution tends to involve WebSocket to localhost, or cloud-enabled printers.

关于 HTML5 和 JavaScript,由于删除了 NPAPI,解决方案往往涉及 WebSocket 到 localhost,或支持云的打印机。

This HTTP/WebSockets design is used by:

此 HTTP/WebSockets 设计用于:

In regards to Point-Of-Sale specific printing, I have been unable to locate a ready solution that meets these needs (pure HTML5 and JavaScript, widely adopted), so either a Desktop-installed middle-ware or a server-side middle-ware is currently the way to achieve what you are describing.

关于销售点特定的打印,我一直无法找到满足这些需求的现成解决方案(纯 HTML5 和 JavaScript,广泛采用),因此无论是桌面安装的中间件还是服务器端中间件—— ware 目前是实现您所描述的内容的方法。

Full disclaimer, we're the authors of QZ Tray.

完全免责声明,我们是 QZ Tray 的作者。

回答by user1912424

You could try PrintNodewhich has a simple desktop client and json API. It's really quick and has lots of libs: https://github.com/PrintNode/

您可以尝试使用具有简单桌面客户端和 json API 的PrintNode。它真的很快并且有很多库:https: //github.com/PrintNode/

回答by Stenerson

I've had good luck with Epson's ePOS-Print JavaScript SDK. It is Epson specific and does require a network interface card that supports ePOS (UB-E04/R04).

我很幸运使用Epson 的 ePOS-Print JavaScript SDK。它是 Epson 特定的,并且确实需要支持 ePOS (UB-E04/R04) 的网络接口卡。