I want to write a POS printer class in java. Everything seems simple with the low ESCPOS coding but i have a question about printer events.
How can I understand if the printer is in error or the paper roll ends? I read the ESCPOS command reference and every command is (obviously) uni-directional to printer.
For example i can not print a receipt if the paper ends and if this happends my application must know and stop logging cash issues.
Thank you.
As far as i remember paper out and other basic events are signaled with an (hardware-)event. You have to add an event-listener to your port (ParallelPortEventListener or SerialPortEventListener) to retrieve these events.
http://docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/ParallelPortEventListener.html