Closed u-sour closed 1 month ago
does it happen on all platforms or just certain ones?
@ekasetiawans Yeah, both on iOS and Android.
It seems not all devices using same ESC/POS code for new feeds try to change the Commands.lineFeed here to other line feeds commands
https://escpos.readthedocs.io/en/latest/commands.html
you can trying to use Carriage Return
@ekasetiawans, Okay, after I test and change some line, here's what I founded: Command Line Feed
works on printer mm80 but doesn't work mm58, and Command Carriage Return
works on printer mm58 but doesn't work on mm80.
Here is what I changed If this change's ok for you. I will push all of this for you:
command.dart
static const List<int> lineFeed = [0x0A];
static const List<int> carriageReturn = [0x0D];
flutter_bluetooth_printer_impl.dart
final additional = paperSize == PaperSize.mm58
? <int>[
for (int i = 0; i < addFeeds; i++) ...Commands.carriageReturn,
]
: <int>[
for (int i = 0; i < addFeeds; i++) ...Commands.lineFeed,
];
Test Result (IOS & Android)
Printer mm80
https://github.com/user-attachments/assets/536bf2d3-675e-4f3a-a686-1a42a7abd282
Printer mm58
https://github.com/user-attachments/assets/26dcbed1-990d-4f84-bdcb-9844ec0c0961
hi, bro @ekasetiawans can you confirm this ? Is it okay or not? I will push this pull request for you.
looks good
@ekasetiawans Okay, bro, here: https://github.com/ekasetiawans/flutter_bluetooth_printer_plugin/pull/59 and i close this issue.
@ekasetiawans any idea about this problem? It works on paper size mm80.