2016-06-10 07:22
浏览 124

Javascript - 在客户端热敏打印机上打印(无小程序)

First I want to know if is possible to such thing.

I'm developing a web application where the user has to print receipts on their own thermal printer.

I don't want to use Java applet or Flash on client as with the entry of html5 these technology are going to be not supported by browsers. So I want to do this using PHP on server side, JavaScript on client browser if is possible.

If only JavaScript isn't enough what kind of application should I develop to install on client so it will help the JavaScript to accomplish is duty. I need some information and references how I can reach this objective. (Please No Microsoft technologies for the client app... Java, Python, NodeJs are welcome)

Thanks in advance

图片转代码服务由CSDN问答提供 功能建议



我不想在客户端上使用Java applet或Flash,因为html5的条目不会被浏览器支持。 所以我想在服务器端使用PHP,如果可能的话,在客户端浏览器上使用JavaScript。

如果只有JavaScript是不够的,我应该开发什么样的应用程序来安装在客户端上,这样有助于JavaScript完成任务。 我需要一些信息并参考我如何实现这一目标。 (请不要使用客户端应用程序的Microsoft技术...欢迎使用Java,Python,NodeJ)


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dourang6423
    dourang6423 2016-06-19 09:11

    I have found the way to do a printing with a JAVA client application. Each Client PC that want to do the printing process should install a JAVA application. This JAVA application should be a HttpServer that listen to a specified port and of course should allow CORS. So the flow is this:

    • The JavaScript in the browser do a HTTP request in[port_nr]/[context]

    • The Java application will receive the request with the data to print and then should do the printing process

    The JAVA app of course should be executed on startup so it always will be listening to the request on that port.

    点赞 评论