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

Print from multiple devices at the same time #512

Open
saghbinylb opened this issue Apr 13, 2024 · 1 comment
Open

Print from multiple devices at the same time #512

saghbinylb opened this issue Apr 13, 2024 · 1 comment

Comments

@saghbinylb
Copy link

I developed an order-taking application in a restaurant and I use this great library to print the tickets.
I noticed that when 2 tablets send a text to the same printer at the same time, the printer starts by printing part of the 1st text received then it switches the 2nd text when it receives it without having finished the first text.
I suppose that this problem comes from the fact that when we print a text, there are several consecutive writes sent to the printer for formatting and the printer stupidly executes what it receives from each socket.

Does anyone have an idea that can help me? I'm thinking of modifying the library so that it sends the text and formatting in a single message in the socket.

@DimiDR
Copy link

DimiDR commented Jun 4, 2024

Please share the code, if you made it.
My thoughts:

  1. Library should have a "isBusy" method, to check if the printer is printing at the moment. - don't know if this is available
  2. Create a service running on one of the devices, which takes the messages from all devices and handles the work sequence. - this is not so easy to implement, but then you have one program which actually is using the printing library and devices which only creates the printing strings and sends it to the service.

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

No branches or pull requests

2 participants