• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Using ESC/POS print command to set height of the bar code

  • Thread starter Thread starter Android Question
  • Start date Start date
A

Android Question

Guest
I am using the below code to print bar code. This prints the barcode but i am not able to set the height of the bar code.Below code prints the bar code with very small height.

public void PrintBarCode2(String Code) { byte[] codeData = Code.getBytes();

ArrayList<Byte> command = new ArrayList<Byte>();

command.add(Byte.valueOf((byte) 0x1D));
command.add(Byte.valueOf((byte) 0x77));
command.add(Byte.valueOf((byte) 0x03));

//Height
command.add(Byte.valueOf((byte) 0x1D));
command.add(Byte.valueOf((byte) 0x68));
command.add(Byte.valueOf((byte) 200));

//Position
command.add(Byte.valueOf((byte) 0x1D));
command.add(Byte.valueOf((byte) 0x48));
command.add(Byte.valueOf((byte) 0x03));

//Barcode
command.add(Byte.valueOf((byte) 0x1D));
command.add(Byte.valueOf((byte) 0x6B));
command.add(Byte.valueOf((byte) 0x06));
for (byte byt : codeData) {
command.add(Byte.valueOf(byt));
}
command.add(Byte.valueOf((byte) 0x00));
sendCommand(command);

}

Please help me.
 
Back
Top Bottom