-
Notifications
You must be signed in to change notification settings - Fork 345
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
Slow printing text #5
Comments
Thank you for this! Actually, with my Xprinter XP-N160I I have no performance issues, that's why I haven't noticed this. BTW, I'm not sure if you have mentioned it somewhere already, but what's your printer brand and model, please? |
I'm using an Epson TM-T20ii-003. I also use a rongta rpp300 for its bluetooth but this one is pretty much garbage. Actually if you are interested the rongst has an issue that for some unknown to me reason exposes 2 bluetooth signals one of which does absolutely nothing and unfortunately this is the one your bluetooth library catches. The other one requires password so it probably affects it somehow. I fix this by bonding it beforehand and using this library as well "flutter_bluetooth_serial" to get the already bonded devices. The epson works fine. I have only tested in android so far. |
Unfortunately, changing the styling every time creates this issue (for some printers only): andrey-ushakov/esc_pos_bluetooth#1 However, it seems I've found a way how to avoid this. Could you please test the performance issue using your Epson TM-T20ii-003 and the latest library? Here there is a good test: andrey-ushakov/esc_pos_printer#39 (comment) Thanks! |
In my case it works fine now. |
Ok! I'm closing this issue |
I'm having the same performance issue with an SPRT L31 printer, any help |
Resetting the image after every added text slows printing but changing the styling every time does not.
Removed reset() from here:
void textEncoded(
Uint8List textBytes, {
PosStyles styles = const PosStyles(),
int linesAfter = 0,
}) {
_text(textBytes, styles: styles);
// Ensure at least one line break after the text
emptyLines(linesAfter + 1);
reset();
}
and changed this:
bytes += styles.bold ? cBoldOn.codeUnits : [];
bytes += styles.turn90 ? cTurn90On.codeUnits : [];
bytes += styles.reverse ? cReverseOn.codeUnits : [];
bytes += styles.underline ? cUnderline1dot.codeUnits : [];
bytes += styles.fontType == PosFontType.fontB ? cFontB.codeUnits : [];
// Characters size
if (styles.height.value != PosTextSize.size1.value ||
styles.width.value != PosTextSize.size1.value) {
bytes += Uint8List.fromList(
List.from(cSizeGSn.codeUnits)
..add(PosTextSize.decSize(styles.height, styles.width)),
);
}
to this:
bytes += styles.bold ? cBoldOn.codeUnits : cBoldOff.codeUnits;
bytes += styles.turn90 ? cTurn90On.codeUnits : cTurn90Off.codeUnits;
bytes += styles.reverse ? cReverseOn.codeUnits : cReverseOff.codeUnits;
bytes += styles.underline ? cUnderline1dot.codeUnits : cUnderlineOff.codeUnits;
bytes += styles.fontType == PosFontType.fontB ? cFontB.codeUnits : cFontA.codeUnits;
// Characters size
bytes += Uint8List.fromList(
List.from(cSizeGSn.codeUnits)
..add(PosTextSize.decSize(styles.height, styles.width)),
);
and performance improvements were huge.
Consider testing this and if it works for you too consider changing it.
The text was updated successfully, but these errors were encountered: