2

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();
MindWire
  • 3,969
  • 7
  • 34
  • 46

2 Answers2

3

this works perfect for me:

Connection connection = getZebraPrinterConn();
connection.open();
ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
// this is very important which sets automatic heigth setting for label
connection.write("! U1 JOURNAL\r\n! U1 SETFF 50 2\r\n".getBytes());
printer.printImage(new ZebraImageAndroid(bitmap), 0, 0,800, 1200, false);
connection.close();

This wont waste paper and it will print upto the availability of text/data

Assume that you have to print a receipt of width 800 and height 1200 , but it is printing a receipt of height approx. 1800 . so there is a wastage of a receipt for 600 px of white space to make use of that wastage you can use above code.

  • Explain your code a little. Code only answers are not appreciated. – Sulthan Allaudeen Jul 11 '14 at 05:30
  • Assume that you have to print a receipt of width 800 and height 1200 , but it is printing a receipt of height approx. 1800 . so there is a wastage of a receipt for 600 px of white space to make use of that wastage you can use above code. – Anisetti Nagendra Mar 16 '15 at 11:15
2

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

Ovi Tisler
  • 6,425
  • 3
  • 38
  • 63
  • Hi @OTisler, I have added the code I am using. As you can see I am not using CPCL code directly. From what I can tell the printImage command adds it for me. I am going to do some playing around with your thought process though and see where it leads me. Thanks. – MindWire Oct 25 '11 at 15:00
  • 4
    Turns out this works (if added before calling printImage(): connection.write("! U1 JOURNAL\r\n! U1 SETFF 50 2\r\n".getBytes()); – MindWire Oct 25 '11 at 15:08
  • What if the media is bar-sense or bar-sense with LABEL ? how can we prevent extra feeding after the black mark is encountered ? – SweetWisher ツ Dec 10 '14 at 10:20