You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is one of the alternatives that worked for me. My original plan is to run node-thermal-printer without @thiagoelg/node-printer because the latter didn't get installed in my electron app.
lettp=newThermalPrinter({type: PrinterTypes.EPSON,// Printer type: 'star' or 'epson'interface: "printer:Xprinter XP-T371U",// Printer interfacecharacterSet: CharacterSet.ISO8859_2_LATIN2,// Printer character setoptions: {timeout: 5000,// Connection timeout (ms) [applicable only for network printers] - default: 3000},driver: {},// Empty object});tp.println("Hello World");tp.table(["One","Two","Three"])tp.cut();constraw=tp.getBuffer()letdevice=usb.findByIds(/*vid*/8137,/*pid*/8214);if(device){device.open();console.log(device.interfaces?.at(0)?.endpoints)device.interfaces?.at(0)?.claim();constoutEndpoint=device.interfaces?.at(0)?.endpoints.find(e=>e.direction==='out');if(outEndpoint){outEndpoint.transferType=2;outEndpoint.transfer(raw,(err)=>{device.close();});}}
What's the issue?
Hi. I just wanted to know what should be set as the
driver
.I just wanted to open the cash drawer attached to the printer
XP-80C
(almost similar toEPSON
), I've already tried the following packages:@flovy/node-printer
@thiagoelg/node-printer
When using the above packages as driver whenever I execute this line of code:
The entire electron app crashes and goes blank.
TeamViewer_9xl8UXRqI6.mp4
The text was updated successfully, but these errors were encountered: