mazenrashed / Printooth

A well documented, high-level Android interface that makes printing via bluetooth printers easier
Mozilla Public License 2.0
399 stars 113 forks source link

Arabic words issue #73

Open MohamedHadjersi96 opened 3 years ago

MohamedHadjersi96 commented 3 years ago

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

mazenrashed commented 3 years ago

اهلا بك، انصحك بتجريب ال 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 .

MohamedHadjersi96 commented 3 years ago

السلام عليكم بارك الله فيكم سوف أبحث عن 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>

ahmedsaber00 commented 2 years ago

جرب كده

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"
AhmedOmara14 commented 1 year ago

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

AhmedTawfiqM commented 9 months ago

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