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

前端 未结 2 966
萌比男神i
萌比男神i 2020-12-17 06:34

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 lo

相关标签:
2条回答
  • 2020-12-17 07:22

    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

    0 讨论(0)
  • 2020-12-17 07:22

    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.

    0 讨论(0)
提交回复
热议问题