brasizza/sunmi_printer

error in format in row with language arabic

Opened this issue · 15 comments

await SunmiPrinter.printRow(cols: [
ColumnMaker(
text: 'الاجمالي',
width: 6,
align: SunmiPrintAlign.LEFT),
ColumnMaker(
text: 'الكمية',
width: 6,
align: SunmiPrintAlign.CENTER),
ColumnMaker(
text: 'الوحدة',
width: 6,
align: SunmiPrintAlign.RIGHT),
ColumnMaker(
text: 'الاسم',
width: 20,
align: SunmiPrintAlign.RIGHT),
]);}

This row cannot print in arabic =(

I have the same issue here, can there be away to fix it? or what do you prefer us to do?

Thanks @brasizza, I found this repository that supports Arabic for Sunmi printers (I tested it on Sunmi v2):
https://github.com/andrey-ushakov/flutter_sunmi_printer

@tebalink just add the master branch on pubspec.yaml, and then the method names need some refactoring afterwards:
flutter_sunmi_printer:
git:
url: https://github.com/andrey-ushakov/flutter_sunmi_printer.git
ref: master

Thanks @brasizza, I found this repository that supports Arabic for Sunmi printers (I tested it on Sunmi v2):

https://github.com/andrey-ushakov/flutter_sunmi_printer

@tebalink just add the master branch on pubspec.yaml, and then the method names need some refactoring afterwards:

flutter_sunmi_printer:

git:

  url: https://github.com/andrey-ushakov/flutter_sunmi_printer.git

  ref: master

He uses the other method that support arabic but doesn't work well in otherzz cases. I can put a propertie in printrow to say if you are print arabic (true/false) and change internally between this 2 methods. This suits you?

Thanks @brasizza, I found this repository that supports Arabic for Sunmi printers (I tested it on Sunmi v2):
https://github.com/andrey-ushakov/flutter_sunmi_printer
@tebalink just add the master branch on pubspec.yaml, and then the method names need some refactoring afterwards:
flutter_sunmi_printer:

git:

  url: https://github.com/andrey-ushakov/flutter_sunmi_printer.git

  ref: master

He uses the other method that support arabic but doesn't work well in otherzz cases. I can put a propertie in printrow to say if you are print arabic (true/false) and change internally between this 2 methods. This suits you?

Thanks, that would be actually really good to have that feature, and actually solves the problem.

Thanks @brasizza, I found this repository that supports Arabic for Sunmi printers (I tested it on Sunmi v2):
https://github.com/andrey-ushakov/flutter_sunmi_printer
@tebalink just add the master branch on pubspec.yaml, and then the method names need some refactoring afterwards:
flutter_sunmi_printer:

git:

  url: https://github.com/andrey-ushakov/flutter_sunmi_printer.git

  ref: master

He uses the other method that support arabic but doesn't work well in otherzz cases. I can put a propertie in printrow to say if you are print arabic (true/false) and change internally between this 2 methods. This suits you?

Thanks, that would be actually really good to have that feature, and actually solves the problem.

Can you try this git ?

https://github.com/brasizza/sunmi_printer.git

now in SunmiPrinter.printRow you can have a second argument called isArabic. this is default as false and you can turn to true if you are printing only arabic text.

If you can try and give me the feedback, and then i can put in pub.dev because i dont have this sunmi with me at this moment!

Best regards!

@brasizza
i tried the new changes(isArabic) in sunmi v2 pro
but the result is white space no matter the text is arabic or not

                         await SunmiPrinter.initPrinter();
                          await SunmiPrinter.startTransactionPrint(true);
                          await SunmiPrinter.line();
                          await SunmiPrinter.printRow(cols: [
                            ColumnMaker(
                                text: 'اسم المشترك',
                                width: 6,
                                align: SunmiPrintAlign.LEFT),
                            ColumnMaker(
                                text: 'اسم المشترك',
                                width: 6,
                                align: SunmiPrintAlign.RIGHT),
                          ], isArabic: true);
                          await SunmiPrinter.line();
                          await SunmiPrinter.lineWrap(5);
                          await SunmiPrinter.exitTransactionPrint(true);

i tried different situations but the result is the same
it seems this command doesn't do any thing
all this three codes print the same result
Screenshot 2024-01-30 at 6 21 29 PM

I checked and tested before update it.
i will be able to test this again only on thursday, but i will check and give you the feedback @bonaparta13

@brasizza ok thanks , i'm waiting

image

imgg

image

@bonaparta13 its working here .
are you using 2.1.2 ?

@brasizza
i'm using the plugin like this

  sunmi_printer_plus: 
    git:
     url: https://github.com/brasizza/sunmi_printer.git

i tested it again and i got the same result i got before
here is my device
WhatsApp Image 2024-02-02 at 1 39 25 PM

Hmmmm maybe its the vs2. Its a small device isn't it? I have only the k2 and k2 mini

Thanks @brasizza, I found this repository that supports Arabic for Sunmi printers (I tested it on Sunmi v2):
https://github.com/andrey-ushakov/flutter_sunmi_printer
@tebalink just add the master branch on pubspec.yaml, and then the method names need some refactoring afterwards:
flutter_sunmi_printer:

git:

  url: https://github.com/andrey-ushakov/flutter_sunmi_printer.git

  ref: master

He uses the other method that support arabic but doesn't work well in otherzz cases. I can put a propertie in printrow to say if you are print arabic (true/false) and change internally between this 2 methods. This suits you?

Thanks, that would be actually really good to have that feature, and actually solves the problem.

i used this plugin and it works
but as you said you currently use the same function he uses
and when i read the code i found that
but i don't know why your plugin don't work in my device
may be different versions of sunmi sdk between you and him
i don't know 🥲
...

Hmmmm maybe its the vs2. Its a small device isn't it? I have only the k2 and k2 mini

yeah it's small device
but every thing is work well except Arabic letters in row