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.

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

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试