简体   繁体   中英

Javascript - Print on thermal printer on client (No applet)

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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