sunmi_printer icon indicating copy to clipboard operation
sunmi_printer copied to clipboard

error in format in row with language arabic

Open tebalink opened this issue 2 years ago • 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), ]);}

tebalink avatar Sep 22 '22 14:09 tebalink

This row cannot print in arabic =(

brasizza avatar Sep 22 '22 20:09 brasizza

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

jihadmahdi avatar Dec 21 '23 11:12 jihadmahdi

https://file.cdn.sunmi.com/SUNMIDOCS/SunmiPrinter-Developer-Docs-1-1.pdf

Captura de Tela 2023-12-21 às 12 46 33

brasizza avatar Dec 21 '23 15:12 brasizza

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

jihadmahdi avatar Dec 22 '23 11:12 jihadmahdi

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?

brasizza avatar Dec 22 '23 11:12 brasizza

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.

jihadmahdi avatar Dec 22 '23 23:12 jihadmahdi

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 avatar Dec 23 '23 01:12 brasizza

@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

bonaparta13 avatar Jan 30 '24 16:01 bonaparta13

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 avatar Jan 30 '24 19:01 brasizza

@brasizza ok thanks , i'm waiting

bonaparta13 avatar Jan 31 '24 11:01 bonaparta13

image

imgg

image

@bonaparta13 its working here . are you using 2.1.2 ?

brasizza avatar Feb 01 '24 19:02 brasizza

@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

bonaparta13 avatar Feb 02 '24 11:02 bonaparta13

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

brasizza avatar Feb 02 '24 11:02 brasizza

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 🥲 ...

bonaparta13 avatar Feb 02 '24 11:02 bonaparta13

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

bonaparta13 avatar Feb 02 '24 11:02 bonaparta13