esc_pos_printer
esc_pos_printer copied to clipboard
Expose the flush method of the underlying socket
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();