 <p>This worked for me:</p> <blockquote> <p>To remove extra space Use the code as</p> <pre><code>zpc.write("! UTILITIES\r\nIN-MILLIMETERS\r\nSETFF 10 2\r\nPRINT\r\n".getBytes()); zp.getGraphicsUtil().printImage(bmp,0,0,100,100,false); </code></pre> <p>where the 4th and the 5th parameters can be as you required ...</p> </blockquote>