Java and thermal printer

Does anyone know how to print a receipt using Java? I have been looking for Google for a long time. Java POS seems to be a good solution. I'll take a quick look at it and it looks appropriate for the Java printer driver. My printer is cheap, support for ESC, but only a driver for Windows.

I also tried:

 FileWriter out = new FileWriter("LPT1");

This does not work,

java.io.FileNotFoundException: lpt1 (The system cannot find the file indicated)

Printing does not work.

Does anyone know how to do this? Thank.

+3
source share
4 answers

Is the Java print service API used ? If not, maybe a javacomm package, since you are writing to the serial port.

+1
source

:

FileWriter out = new FileWriter("LPT1:");

.

+1

IP-? , 9100, ( ) . escape-, (, ).

0

- API JavaPOS; , , . JavaPOS, .

JavaPos

0

Source: https://habr.com/ru/post/1732656/


All Articles