I can print anything but the barcode, I currently use:
byte[] cmd = new byte[3];
cmd[0] = 0x1b;
cmd[1] = 0x21;
cmd[2] &= 0xEF;
out.write(cmd);
out.write("Mensagem de teste \n".getBytes());
The printer is the ZJ-5802DD, I have already tried several codes, I downloaded some language manuals:
To print the barcode would look like this:
String content = "1234567890";
byte[] contents = content.getBytes();
byte[] formats = {(byte) 0x1d, (byte) 0x6b, (byte) 0x49, (byte)content.length()};
byte[] bytes = new byte[formats.length + contents.length];
System.arraycopy(formats, 0, bytes, 0, formats.length );
System.arraycopy(contents, 0, bytes, formats.length, contents.length);
out.write(bytes);
But it does not work, here post where they claim to get on the same printer , because it supports but did not post the code: (