Search code examples
androidzebra-printers

How to stop a Zebra Printer RW 420 from automatically feeding lots of extra paper when issuing command printImage from printer.getGraphicsUtil?


I am using a zebra RW420 in an android project and I am coding and I find that even when simply testing the printer using the ZSDK Developer Demos the printer is printing lots of extra paper when it is issued a print command. In this case I am testing out the signature capture and print demo. I do find that if I connect it to the computer and print a label created using Zebra Designer it prints the label properly with no extra paper (in fact i wouldn't mind a couple of millimeters extra in that case).

If any one knows how to save some trees here that would be great!

The code in question is:

connection.open();
ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
GraphicsUtil g = printer.getGraphicsUtil();
Bitmap image = signatureArea.getBitmap();

g.printImage(image, 0, 0, image.getWidth(), image.getHeight(), false);

connection.close();

Solution

  • Do you have the keyword "FORM" in your CPCL label? It's usually before PRINT

    This tells the printer to form feed after printing to the top-of-form setting the printer is configured to. To disable it, you can remove the FORM keyword from your format if you don't need it, or you can set the top-of-form to 0.

    ! U1 getvar "media.tof"
    

    will show you what your top-of-form is currently set to

    ! U1 setvar "media.tof" "0"
    

    will set it to 0, so that the FORM will feed 0 dots