Use Node js to to print data to thermal printer

旧时模样 提交于 2021-02-10 21:55:29

问题


I'm developing an application with Node JS where I need to see all available printers in the user's machine, let the user select one of them and print a receipt.

Is there a way to achieve this in macOS and Windows ?

Note , I have checked all examples in internet,nothing helped. Kindly provide me an complete example.


回答1:


In googling there are few libraries that does this job...

Take a look on printer for example, it does all the jobs you require...

getPrinters() to enumerate all installed printers with current jobs and statuses;

getPrinter(printerName)

There a many examples in the github repo to help you :

https://github.com/tojocky/node-printer/tree/master/examples



来源:https://stackoverflow.com/questions/59225919/use-node-js-to-to-print-data-to-thermal-printer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!