【发布时间】:2015-07-29 12:40:36
【问题描述】:
我必须使用热敏打印机打印发票收据。 我用Zjiang Thermal printer 打印收据。 他们还在那里提供manual 和演示项目。 在演示项目中,他们使用库“btsdk.jar”来实现连接和打印。
我已成功建立打印机和安卓设备之间的连接。 但是没有文本对齐(中心、左、右)和单元格宽度、高度的准则。
我have try it。它仅通过更改格式2 变量来更改文本高度。
如何通过蓝牙打印机打印发票。
也请解释一下这部分-
byte[] cmd = new byte[3];
cmd[0] = 0x1b;
cmd[1] = 0x21;
cmd[2] |= 0x10;
cmd2 - 用于改变字体高度 cmd[0] & cmd1有什么用
在演示项目中向蓝牙打印机发送打印消息的代码
String msg = "";
byte[] cmd = new byte[3];
cmd[0] = 0x1b;
cmd[1] = 0x21;
cmd[2] |= 0x10;
mService.write(cmd);
mService.sendMessage("Congratulations!\n", "GBK");
cmd[2] &= 0xEF;
mService.write(cmd);
msg = " You have sucessfully created communications between your device and our bluetooth printer.\n\n"
+" the company is a high-tech enterprise which specializes" +
" in R&D,manufacturing,marketing of thermal printers and barcode scanners.\n\n";
mService.sendMessage(msg,"GBK");
打印信息-
parameters:support to download the Logo trademark
FontA:12*24 dots,1.5(W)*3.0(H) mm
FontB:9*17 dots, 1.1(W)*2.1(H) mm
Simplified/Traditional: 24*24 dots, 3.0(W)*3.0(H)
Line spacing: 3.75mm (Default)
Barcode Types:-
1D Barcode- UPC-A/UPC-E, JAN13(EAN13), JAN8(EAN8), CODE39/ITF, CODABAR,CODE93
2d Barcode- QR CODE
发票收据
【问题讨论】:
-
从哪里可以下载这个SDK??
-
您成功打印收据了吗??
-
如何在同一行打印左右对齐?
标签: android android-bluetooth thermal-printer