escpos-buffer
escpos-buffer copied to clipboard
How connect to printer?
I have a printer model TM T20X from Epson, nothing happens with this function:
(async () => { const model = new Model('TM-T20') const connection = new InMemory() const printer = await Printer.CONNECT(model, connection) await printer.setColumns(56) await printer.write('Simple Text *** ') await printer.writeln('Bold Text -> complete line text.[]123456', Style.Bold) await printer.writeln('Double Height', Style.DoubleHeight | Style.Bold, Align.Center) await printer.writeln('Double Width', Style.DoubleWidth, Align.Center) await printer.writeln('Áçênts R$ 5,00', Style.DoubleWidth | Style.DoubleHeight, Align.Center) await printer.feed(6) await printer.buzzer() await printer.cutter() await printer.drawer(Drawer.First) process.stdout.write(connection.buffer()) })()