Posts

Showing posts with the label pos

How to print the text right aligned in a Bluetooth POS Printer?

How to print the text right aligned in a Bluetooth POS Printer? I have been trying to do a POS app in android where I am printing the receipt on a Bluetooth printer connected to the app. I am able to print 'large', 'small' and QR code with the HOINSDK provided with the device and also I am able to align then 'left' and 'centre' but unable to align it to the 'right'. Any help is appreciated. Below are the codes for respective things: //For Large Text cmd[0] = 27; cmd[1] = 97; cmd[2] &= 0xEF; mService.write(cmd); mService.sendMessage("" + large_txt.getText().toString(), "GBK"); //For Small Text cmd[0] = 0x1b; cmd[1] = 0x21; cmd[2] &= 0xEF; mService.write(cmd); mService.sendMessage("" + small_txt.getText().toString(), "GBK"); //For Cent...