Reputation: 113
I am using EPSON android SDK to print transaction receipt but when trying to print arabic character along with English character, it prints arabic in reverse order.
Like I am printing خدمة تعبئة و تغليف but print
Please let me know the possible solution of this problem.
Upvotes: 2
Views: 1530
Reputation: 4350
It seems that the current EPSON normal ESC/POS printer/device driver/EPSON's library does not have a right-to-left printing function.
There seems to be an example of taking special measures for a specific version of a specific environment, but it is not something that can be applied to other environments.
Arabic Font Printing via OPOS Printer (EPSON TM-T88V)
Probably, as a countermeasure with the smallest amount of data, create only the Arabic character part as bit image data to be printed with the ESC * command, create the ASCII character part as text, and send them in combination. Will do.
However, TM-P60II does not seem to support the ESC * command.
In that case, you will only be able to use one of the following methods.
Programmatically, it would be easy to create all the contents including ASCII and Arabic characters as one bit image data, send it, and print it.
However, the printing speed seems to be slow.
Alternatively, it is possible to determine the presence or absence of Arabic characters on a line-by-line basis, print text data if only ASCII characters are included, and create and print as bit image data if Arabic characters are included.
It's not recommended as the ASCII fonts will be disjointed, but it will be a bit faster than printing everything as a bit image.
For example, is the escpos-php library prototyped with such an issue?
However, it seems that it has not been officially implemented.
Add support for right-to-left text output #6
Arabic printing problem #455
How can i print arabic in POS printer? #757
Alternatively, you could try printing with character encoding by implementing your own inversion of sentences containing Arabic characters, as the Python library module does in this article.
how to fix the reversed Lines when using arabic-reshaper and python-bidi (in multiple lines situation)?
Upvotes: 1