-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Driver for electron application #214
Comments
have you found any solutions or alternatives ? |
This is one of the alternatives that worked for me. My original plan is to run let tp = new ThermalPrinter({
type: PrinterTypes.EPSON, // Printer type: 'star' or 'epson'
interface: "printer:Xprinter XP-T371U", // Printer interface
characterSet: CharacterSet.ISO8859_2_LATIN2, // Printer character set
options: {
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();
const raw = tp.getBuffer()
let device = usb.findByIds(/*vid*/8137, /*pid*/8214);
if (device) {
device.open();
console.log(device.interfaces?.at(0)?.endpoints)
device.interfaces?.at(0)?.claim();
const outEndpoint = device.interfaces?.at(0)?.endpoints.find(e => e.direction === 'out');
if (outEndpoint) {
outEndpoint.transferType = 2;
outEndpoint.transfer(raw, (err) => {
device.close();
});
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: