Open compassbelgium opened 6 months ago
printTicket(ticket:string) { this.thermalPrinter.listPrinters({type: 'usb'}, (printers) => { if (printers.length > 0) { var ptr = printers[0]; this.thermalPrinter.printFormattedText({ type: 'usb', id: ptr.id, text: ticket // new lines with "\n" }, function() { console.log('Successfully printed!'); }, function(error) { console.error('Printing error', error); }); } else { console.error('No printers found!'); } }, function(error) { console.error('Ups, we cant list the printers!', error); }); }
ionic version 7.2.0 capacitor version 5.5.1 angular version 17.3.1
printTicket(ticket:string) { this.thermalPrinter.listPrinters({type: 'usb'}, (printers) => { if (printers.length > 0) { var ptr = printers[0]; this.thermalPrinter.printFormattedText({ type: 'usb', id: ptr.id, text: ticket // new lines with "\n" }, function() { console.log('Successfully printed!'); }, function(error) { console.error('Printing error', error); }); } else { console.error('No printers found!'); } }, function(error) { console.error('Ups, we cant list the printers!', error); }); }
ionic version 7.2.0 capacitor version 5.5.1 angular version 17.3.1