JavaPOS Hello World in Java

微笑、不失礼 提交于 2019-12-03 00:24:14

Well, I finally found it myself. It seems like you need a part of the program from JavaPOS (that part only has interfaces and abstract classes) and you need the library from the manufacturer of the device. The jpos.xml is generated after the printer is installed. A software (also provided by the manufacturer) generates entries in the jpos.xml file based on the name of the printer and other settings. You must include this file in your program.

Finally, the following code makes the connection to the printer :

POSPrinter printer = new POSPrinter();
// open the printer object according to the entry names defined in jpos.xml
printer.open("printerName");

The method printnormal() is then used to print. If you printing asynchonously, you also need transactionPrint() to empty the buffer.

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