Open ahmedahel opened 3 years ago
@ahmedahel how are you encoding the text? Can you share some code?
Uint8List encoded = await CharsetConverter.encode('windows-1256', "فاتورة ضريبة"); printer.textEncoded(encoded, styles: PosStyles(codeTable: 'PC850', bold: true, align: PosAlign.center));
I have the same problem with printing
@andrey-ushakov Is there any updates ?
Is there any updates ?
I'm facing the same issue!
which version of the esc_pos_utils do you use?
Uint8List encoded = await CharsetConverter.encode('windows-1256', "فاتورة ضريبة"); printer.textEncoded(encoded, styles: PosStyles(codeTable: 'PC850', bold: true, align: PosAlign.center));
I've tested this code and it printed different characters! would you please provide a complete example?
const PaperSize paper = PaperSize.mm80; final profile = await CapabilityProfile.load(); final printer = NetworkPrinter(paper, profile); final PosPrintResult res = await printer.connect(printerIp, port: 9100);
if(res == PosPrintResult.success ){ Uint8List encoded = await CharsetConverter.encode('windows-1256', "فاتورة ضريبة"); printer.textEncoded(encoded,styles:PosStyles(codeTable: 'PC850', bold: true, align: PosAlign.center)); printer.feed(1); printer.cut();
}
@jacobokoenig please update us as soon as possible
Any updates? Facing same issue.
I hope there are updates to this issue
Yes, I faced the same problem I hope there are updates to this issue
@jacobokoenig please update us as soon as possible
any solution ? still i have issue
@iyashiyas go to the printer settings, and then set the printing encoding to UTF-8
@bluemix still not working, const characterSet = 'CP1256';
Uint8List encSeller =
await CharsetConverter.encode(characterSet, "عمل الطباعة العربية");
bytes += ticket.textEncoded(encSeller,
styles: const PosStyles(
height: PosTextSize.size2,
width: PosTextSize.size2,
align: PosAlign.center,
bold: true,
));
my printer is epson tm m-30
see this solution:
i have done same this but issue is image printing slowly. it is only a temporary solution the large data will not print.
in printer settings, i mean, the Android settings of the device. @iyashiyas
@bluemix no use.. there is no option to change
You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.
And this is what I did and it printed arabic perfectly
final encodedStr = utf8Encoder.convert(invoice.description);
bytes += generator.textEncoded(Uint8List.fromList([
...[0x1C, 0x26, 0x1C, 0x43, 0xFF],
...encodedStr
]))
Thank you @AbdurrahmanElrayes for the effort!
Thank you so much, this is the only solution that worked for me. @AbdurrahmanElrayes
You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation.
And this is what I did and it printed arabic perfectly
final encodedStr = utf8Encoder.convert(invoice.description); bytes += generator.textEncoded(Uint8List.fromList([ ...[0x1C, 0x26, 0x1C, 0x43, 0xFF], ...encodedStr ]))
not working for me. it still printing Chinese characters
You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation. And this is what I did and it printed arabic perfectly
final encodedStr = utf8Encoder.convert(invoice.description); bytes += generator.textEncoded(Uint8List.fromList([ ...[0x1C, 0x26, 0x1C, 0x43, 0xFF], ...encodedStr ]))
not working for me. it still printing Chinese characters
What printer do you use?
You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation. And this is what I did and it printed arabic perfectly
final encodedStr = utf8Encoder.convert(invoice.description); bytes += generator.textEncoded(Uint8List.fromList([ ...[0x1C, 0x26, 0x1C, 0x43, 0xFF], ...encodedStr ]))
not working for me. it still printing Chinese characters
What printer do you use?
SRP-330ii and an inbuilt printer(Citaq H10 POS)
You can try this command and set the code page to 22 or 40 for arabic characters. That's what the printer manuals says. you can find it in this pdf page 47: https://data2.manualslib.com/pdf7/272/27101/2710088-bixolon/srp330ii.pdf?744f2c5cdecdd9e0c41f9ce36783ab22
@sgsm74
You can try this command and set the code page to 22 or 40 for arabic characters. That's what the printer manuals says. you can find it in this pdf page 47: https://data2.manualslib.com/pdf7/272/27101/2710088-bixolon/srp330ii.pdf?744f2c5cdecdd9e0c41f9ce36783ab22 @sgsm74
Thank you so much, what about the other device??do you got anything??I can print on it but It is reversed like:م ا ل س
You can try this command and set the code page to 22 or 40 for arabic characters. That's what the printer manuals says. you can find it in this pdf page 47: https://data2.manualslib.com/pdf7/272/27101/2710088-bixolon/srp330ii.pdf?744f2c5cdecdd9e0c41f9ce36783ab22 @sgsm74
Thank you so much, what about the other device??do you got anything??I can print on it but It is reversed like:م ا ل س
You're welcome. Unfortunately, I couldn't find detailed docs about this printer yet.
You have to find the character table for your printer and write the corresponding commands to let the printer know that you are printing multi byte characters such as Arabic characters. In my case, I was using sunmi printer and the only thing that worked for me was finding its character table and I wrote the commands and it worked very well. Here's a picture of what they said in the documentation. And this is what I did and it printed arabic perfectly
final encodedStr = utf8Encoder.convert(invoice.description); bytes += generator.textEncoded(Uint8List.fromList([ ...[0x1C, 0x26, 0x1C, 0x43, 0xFF], ...encodedStr ]))
not working for me. it still printing Chinese characters
What printer do you use?
Can you help me with epson tm30 please ?
I tried the above solutions but they didn't work out for me. my Arabic code page is 92. Do I need to change anything in these numbers? [0x1C, 0x26, 0xM1C, 0x43, 0xFF]
I am using bixolon srp-e300 and it's code table is 22. (https://bixolon.com/_upload/manual/Manual_SRP-E300302_Code_Page_english_Ver_1_01.pdf).
but i am still getting some random arabic letters
I tried the above solutions but they didn't work out for me. my Arabic code page is 92. Do I need to change anything in these numbers?
Hi, it's very easy to support utf8 encoding which would help you print many languages. You just have to add an entry in the default section of capabilities.json and if you don't want to bother with that, you can use my fork:
https://github.com/waqadArshad/esc_pos_utils
as:
esc_pos_utils:
git:
url: https://github.com/waqadArshad/esc_pos_utils.git
and if it fixes your issue, please remember to STAR the repo.
Hi, it's very easy to support utf8 encoding which would help you print many languages. You just have to add an entry in the default section of capabilities.json and if you don't want to bother with that, you can use my fork:
https://github.com/waqadArshad/esc_pos_utils
as:
esc_pos_utils: git: url: https://github.com/waqadArshad/esc_pos_utils.git
and if it fixes your issue, please remember to STAR the repo.
Hi, is it possible to explain more? For example, should we give a specific profile, or how to select the UTF8 you added?
Hi Dear,
I'm trying to print receipt in Arabic language but the text some times appear as Inverse and dashed My Printer Model is : TM-m30 . Table Code WPC1256 , PC864 and PC720 . CharsetConverter: cp864, windows-1256.
I get these code from https://reference.epson-biz.com/modules/ref_charcode_en/index.php?content_id=47.