Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the flush method of the underlying socket #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bennik2000
Copy link

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant