Reputation: 21
I am trying to print a single image to a zebra printer from android.
List of things i already tried(not exactly in this order).zp is a ZebraPrinter,zpc is a ZebraPrinterConnection
Version 1 - prints blank (however the height seems to be correct)
zpc.write("! U1 JOURNAL \r\n U1 SETFF 50 2 \r\n");
zp.getGraphicsUtil().printImage(bmp,0,0,-1,-1,false);
Version 2 - prints blank (however the height seems to be correct)
zpc.getToolsUtil.sendCommand("! U1 JOURNAL \r\n U1 SETFF 50 2 \r\n");
zp.getGraphicsUtil().printImage(bmp,0,0,-1,-1,false);
Version 3 -prints image followed by a lot of empty space,there are no issues with the image in this case it looks great
zp.getGraphicsUtil().printImage(bmp,0,0,-1,-1,false);
Notes:
1.tried ZPL,the printer language isn't ZPL,its probably CPCL(which is unknown to me)
2.text files print ok,so the printer's working fine
Upvotes: 2
Views: 3934
Reputation: 3660
To remove extra space Use the code as
zpc.write("! UTILITIES\r\nIN-MILLIMETERS\r\nSETFF 10 2\r\nPRINT\r\n".getBytes());
zp.getGraphicsUtil().printImage(bmp,0,0,100,100,false);
where 4th and 5th parameter can be as you required ...
Upvotes: 2
Reputation: 6473
So, you want the image to print correctly but not have the extra whitespace at the end, correct?
If that's what you want, then your SETFF
command needs to be fixed. You need to send down something like this (see the CPCL manual for more options of the SETFF command:
! UTILITIES
IN-MILLIMETERS
SETFF 50 2
PRINT
The code would look something like this :
zpc.write("! UTILITIES\r\nIN-MILLIMETERS\r\nSETFF 10 2\r\nPRINT\r\n".getBytes());
zp.getGraphicsUtil().printImage(bmp,0,0,-1,-1,false);
Upvotes: 1