doumeng1897 2016-06-10 07:22
浏览 711
已采纳

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

  • 写回答

1条回答 默认 最新

  • 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 http://127.0.0.1:[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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 怎么在stm32门禁成品上增加记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 解riccati方程组