非位图打印指令
initPrinter();
byte[] alignByte = { 0x1B, 0x61, 1 };// 0:左对齐;1:居中;2:右对齐
mBluetoothService.write(alignByte);
byte[] hb = null;
hb = conetnt.getBytes();//二维码内容
// 0x1f,0x1c,0x08,0x03,0x0a,0x00,0x30,0x31,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x0a//一个二维码指令
byte[] code2 = new byte[7 + hb.length];
code2[0] = 0x1f; // 打印二维码
code2[1] = 0x1c;
code2[2] = 0x08;
code2[3] = 0x03;
code2[4] = (byte) hb.length;
code2[5] = 0x00;
for (int i = 0; i < hb.length; i++) {
code2[6 + i] = hb[i];
}
code2[code2.length - 1] = 0x0a;// 换行
mBluetoothService.write(code2);