node-thermal-printer icon indicating copy to clipboard operation
node-thermal-printer copied to clipboard

openCashDrawer doesn't work for me

Open Wolyo opened this issue 1 year ago • 0 comments

Finally after having some difficulties to be able to use this library, I was able to print a ticket using the example just add printer.openCashDrawer(); but it does not open it, I use it in the click event of a button but the first time it does not open it but if I click more times it does open it and it opens it as many times as it does but if I put at least one println it prints the text as many times as I click the button and I only need to open it with a button and after printing, would you please help me?

excuse my english i used translator :P, but i can read it almost perfect

try {
  let execute = printer.execute()
  printer.openCashDrawer();
  console.error("Print done!");
} catch (error) {
  console.log("Print failed:", error);
}

Wolyo avatar Jul 26 '22 12:07 Wolyo