Printooth icon indicating copy to clipboard operation
Printooth copied to clipboard

Arabic words issue

Open MohamedHadjersi96 opened this issue 3 years ago • 5 comments

Hello poeple, Actually i'm working on appcliation which use a Bluetooth printer but i have some issues when i want to print arabic words. i know that this library support arabic language but my probléme is when i print an arabic words i find that the word is not fully correct. for example : Arabic word = سلطان when i print this word i get = سلط ان

i want to know if this issues is due of printer or the library please i want your help.

thank you

MohamedHadjersi96 avatar Apr 11 '21 12:04 MohamedHadjersi96

اهلا بك، انصحك بتجريب ال sdk التي اتت مع الطابعة، اذا كانت تعطي نفس النتيجة، فاني اعتقد انك يجب ان تتقبل الواقع، اما اذا كانت تطبع بطريقة صحيحة فيجب ان تراجع دفتر تعليمات المطور الخاص بالطابعة او ان تقرأ الكود المصدري لل sdk الخاص بالطابعة

On Sun, Apr 11, 2021, 3:48 PM MohamedHadjersi96 @.***> wrote:

Hello poeple, Actually i'm working on appcliation which use a Bluetooth printer but i have some issues when i want to print arabic words. i know that this library support arabic language but my probléme is when i print an arabic words i find that the word is not fully correct. for example : Arabic word = سلطان when i print this word i get = سلط ان

i want to know if this issues is due of printer or the library please i want your help.

thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mazenrashed/Printooth/issues/73, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3FFKTLSDVD43BEHERBES3TIGLCZANCNFSM42XUBEOA .

mazenrashed avatar Apr 11 '21 14:04 mazenrashed

السلام عليكم بارك الله فيكم سوف أبحث عن sdk الخاص بالطابعة و أرى إن كانت تعطيني نفس الناتج مشكورين عن المجهودات

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#m_-6070763414660817748_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le dim. 11 avr. 2021 à 15:55, Mazen Rashed @.***> a écrit :

اهلا بك، انصحك بتجريب ال sdk التي اتت مع الطابعة، اذا كانت تعطي نفس النتيجة، فاني اعتقد انك يجب ان تتقبل الواقع، اما اذا كانت تطبع بطريقة صحيحة فيجب ان تراجع دفتر تعليمات المطور الخاص بالطابعة او ان تقرأ الكود المصدري لل sdk الخاص بالطابعة

On Sun, Apr 11, 2021, 3:48 PM MohamedHadjersi96 @.***> wrote:

Hello poeple, Actually i'm working on appcliation which use a Bluetooth printer but i have some issues when i want to print arabic words. i know that this library support arabic language but my probléme is when i print an arabic words i find that the word is not fully correct. for example : Arabic word = سلطان when i print this word i get = سلط ان

i want to know if this issues is due of printer or the library please i want your help.

thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mazenrashed/Printooth/issues/73, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AB3FFKTLSDVD43BEHERBES3TIGLCZANCNFSM42XUBEOA>

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mazenrashed/Printooth/issues/73#issuecomment-817320948, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATUBSVRNJETWOXSSXRUIWEDTIGZ7JANCNFSM42XUBEOA .

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Garanti sans virus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

MohamedHadjersi96 avatar Apr 11 '21 15:04 MohamedHadjersi96

جرب كده

public static byte[] POS_Print_Text(String pszString, String encoding, int codepage, int nWidthTimes, int nHeightTimes, int nFontType) {
        if (codepage < 0 || codepage > 255 || pszString == null || pszString.length() < 1) {
            return null;
        }
        try {
            byte[] pbString = pszString.getBytes(encoding);
            Command.GS_ExclamationMark[2] = (byte) (new byte[]{0, 16, 32, 48}[nWidthTimes] + new byte[]{0, 1, 2, 3}[nHeightTimes]);
            Command.ESC_t[2] = (byte) codepage;
            Command.ESC_M[2] = (byte) nFontType;
            if (codepage == 0) {
                return Other.byteArraysToBytes(new byte[][]{Command.GS_ExclamationMark, Command.ESC_t, Command.FS_and, Command.ESC_M, pbString});
            }
            return Other.byteArraysToBytes(new byte[][]{Command.GS_ExclamationMark, Command.ESC_t, Command.FS_dot, Command.ESC_M, pbString});
        } catch (UnsupportedEncodingException e) {
            return null;
        }
    }
printable.add(
            RawPrintable.Builder(
                PrinterCommand.POS_Print_Text(
                    "الأسم:\n",
                    ARABIC, 22, 0, 0, 0
                )
            ).build()
        )
    const val ARABIC = "ISO-8859-6"

ahmedsaber00 avatar Mar 01 '22 13:03 ahmedsaber00

@ahmedsaber00 after using your solution, How to solve it? WhatsApp Image 2023-02-28 at 12 25 15 AM

AhmedOmara14 avatar Feb 27 '23 22:02 AhmedOmara14

@AhmedOmara14 ممكن تكلمني ضروري محتاج اظبط العربي بقالي اسابيع حرفيا فيها واتس اب : 01159545785

AhmedTawfiqM avatar Dec 23 '23 07:12 AhmedTawfiqM