I'm trying to print a QR code on a Custom VKP printer. The printer supports QR codes. I send ESC/POS commands to it, but all that is printed is the text and not the QR code. The following is my code in Java
:
String content = "Hello !!";
int store_len = content.length() + 3;
byte store_pL = (byte) (store_len % 256);
byte store_pH = (byte) (store_len / 256);
byte ESC = 0x1b;
byte[] INIT = new byte[]{ESC, '@'};
byte[] CUT = new byte[]{0x0c};
byte[] FUNC_165 = new byte[]{Commands.GS, 0x28, 0x6b, 0x04, 0x00, 0x31, 0x41, 0x51, 0x00};
byte[] FUNC_167 = new byte[]{Commands.GS, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x43, 0x64};
byte[] FUNC_169 = new byte[]{Commands.GS, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x45, 0x48};
byte[] FUNC_180 = new byte[]{Commands.GS, 0x28, 0x6b, store_pL, store_pH, 0x31, 0x50, 0x30};
byte[] FUNC_181 = new byte[]{Commands.GS, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x51, 0x48};
byte[] FUNC_182 = new byte[]{Commands.GS, 0x28, 0x6b, 0x03, 0x00, 0x31, 0x52, 0x48};
ByteArrayOutputStream writer = new ByteArrayOutputStream();
writer.write(INIT);
writer.write(FUNC_165);
writer.write(FUNC_167);
writer.write(FUNC_169);
writer.write(FUNC_180);
writer.write(content.getBytes());
writer.write(FUNC_181);
writer.write(FUNC_182);
writer.write(CUT);
writer.close();
The output is QHello !!
.
What am I doing wrong here. Any help is appreciated.