esc_pos_printer icon indicating copy to clipboard operation
esc_pos_printer copied to clipboard

Expose the flush method of the underlying socket

Open Bennik2000 opened this issue 1 year ago • 0 comments

This PR exposes the flush() method of the underlying socket. The flush() function should be used before disconnecting in order to send all buffered printing commands to the printer. Under some circumstances (long print jobs, slow network, ...) the printer may not be done printing before a disconnect. Then the last few lines are not printed and the paper may not get cut.

Usage of the exposed flush() method:

await printer.flush();
printer.disconnect();

Bennik2000 avatar Feb 17 '23 12:02 Bennik2000