tojocky / node-printer

Native node.js printer
1.51k stars 436 forks source link

How to print to multiple printers? #297

Closed musahaidari closed 3 years ago

musahaidari commented 3 years ago

I am trying to write a single script to print to multiple printers based on some criteria (at the moment 4 printers). The code for printing you can find at https://gist.github.com/musahaidari/8081c4c58e8740cba875731634bed94c. Basically based on any order (at a restaurant) the waiter takes, it prints to different printers.

The problem I have is it prints only once for the first printer, and the next prints, nothing will print on any printer. Have I missed something here?

tojocky commented 3 years ago

Did you try to the copy copy of the buffer to printer?

musahaidari commented 3 years ago

@tojoky Thanks for the reply, but I did not quite understand what you mean. Can you please further explain it?

musahaidari commented 3 years ago

I added 0.5 second delay between each prints and the problem resolved.