如何使用星形线命令ESC b n1 n2 n3 n4 d1 ... dk RS打印条形码

时间:2013-12-11 23:01:45

标签: java printing label barcode

我需要一个示例,在java中使用此命令打印条形码。条形码我需要10个数字。

ESC b n1 n2 n3 n4 d1 ... dk RS

我有中心,左边和切割,但我需要一个条形码。

 char[] CENTER = new char[] {0x1B, 0x1D, 0x61, 1};
  char[] LEFT = new char[] {0x1B, 0x1D, 0x61, 0};
  char[] cutP = new char[]{0x1b, 0x64, 0};

1 个答案:

答案 0 :(得分:0)

对于JAN / EAN 13条形码

,这是正确的代码

char [] barcodeBeg = new char [] {0x1b,0x62,3,2,3,100,'1','2','3','4',0x34,0x35,0x36,0x33,0x31 ,0x30,0x31,0x32,0x33,0x1E};