esc_pos_printer
esc_pos_printer copied to clipboard
feat: USB Printers
Description:
- Be able to select USB devices
- Be able to write bytes to printer with/without Ticket class
Tested on Issyzone POS - ITPP047
Feedback are welcome!
Regards,
Bai Web and Mobile Lab Team
Hello @andrey-ushakov we have created a PR that will allow the package to support USB. Hope you can review and merge. Thanks!
Hi @iRaySpace , @ccfiel ,
Thank you for your contribution! Unfortunately, I can't review and test it right now but for sure I will do that once I will get a USB printer!
@iRaySpace your writeBytes method doesn't work properly. I changed a few things and it worked for big tickets
` Future<PosPrintResult> writeBytes(List
final List<List<int>> chunks = [];
final len = bytes.length;
//check if total length is lower than chunkSize
if (bytes.length <= chunkSizeBytes) {
chunks.add(bytes);
} else {
for (var i = 0; i < len; i += chunkSizeBytes) {
final end = (i + chunkSizeBytes < len) ? i + chunkSizeBytes : len;
chunks.add(bytes.sublist(i, end));
}
}
for (List<int> data in chunks) {
await Escposprinter.printBytes(data);
sleep(Duration(milliseconds: queueSleepTimeMs));
}
completer.complete(PosPrintResult.success);
await Escposprinter.closeConn;
return completer.future;
}`
@iRaySpace
I am getting this warning :
Note: C:\src\flutter\.pub-cache\git\esc-pos-printer-flutter-3dbaca068eac03e141745d6328758cc422c24bcb\android\src\main\java\br\com\samhaus\escposprinter\EscposprinterPlugin.java uses unchecked or unsafe operations.
any update? test good for me.
Does this work in the web or Windows? @iRaySpace @ccfiel
It is written only for Android. Other platforms were not taken into account. @LucaDillenburg
Does this work in the web or Windows? @iRaySpace @ccfiel
Hi, In fact, on the web you will never have it for security reasons, your system does not have access to the printers, unless it shows the print screen before (never directly)
Now windows I'm on the search right now 😅😁
Hi All, Is there any posibility to use printer which is connected via USB in Windows?