react-native-thermal-receipt-printer-image-qr
react-native-thermal-receipt-printer-image-qr copied to clipboard
Support for changing printer codepage to support arabic?
for now printer printing Arabic letters in a reverse way, any way to support changing the print code page while initializing or with connecting to print with different characters?
You can screen shot your screen and using image or base 64 to print!
https://github.com/gre/react-native-view-shot
@thiendangit this is a good workaround, yes but it will prevent using all good APIs provided by this package including print columns and others, you will need to implement full receipt with react native UI then print it as an image also, it gives a bad performance printing image instead of just text I know another package that is supporting changing codepage can u try to check its native code if u can clone it to yours? https://github.com/mrefaie/react-native-esc-pos-sahaab
EscPos.setCodePage(config?.codePage);
it was having 2 issues, one for changing codepage and I think it's the easy part and the second was that the string was reversed, they solved it from the native side but I think I can push the string reversed from the js side
also, I found that ESC pos encoder can generate commands with codepage I will try it and give you feedback
let result = encoder .codepage('windows1251') .text('Iñtërnâtiônàlizætiøn') .codepage('cp737') .text('ξεσκεπάζω την ψυχοφθόρα βδελυγμία') .encode()
@Mohamed-kassim is it working ?
@thiendangit I tested it more than once it's not working, but I think it's about printer mapping so I am trying again let me explain it briefly every printer have a list of codepages every codepage have value and page for every printer
the old package was taking the codepage index from the user as the user know what's the language he need to print with so he picks it from the printer configuration file -included image- then the package map it to the right hex code command >> and this is approach is very good
for example I need to assign cp864 for old package I assign 22 from this image for encode I assign cp864
but esc pos encoder takes the value, not the index which maps for every printer differently u can check their source files for mappings so I think my printer mappings are different so it's not working I will try again with custom mapping to check if it's working
sorry for being late I will try to test It again as fast as possible
@Mohamed-kassim many tks! i'll try in weekend!
Are you able to solve it?
any way to print Arabic letters ?
any success?