3 Replies Latest reply on Mar 9, 2017 8:13 AM by Karin Beck

    Problem printing PNG on ZTC 140Xi4 / 140Xi3

    Karin Beck

      Hello,

       

      we are developing a software to print png images with Zebra SDK. The labels can be printed, but they are cut off.

      We have tried to control the cuttig using the SETFF command but it doesn't work like expected:

       

      Here is our code:

       

       

      printer.getConnection().write("! U1 JOURNAL\r\n! U1 SETFF 50 200\r\n".getBytes());
      
      zplStart = "^XA";
      
      zplEnd = "^XZ";
      
      printer.getConnection().write(zplStart.getBytes());
      
      printer.printImage(filename, 0, 0, 944, 1120, true);
      
      printer.getConnection().write(zplEnd.getBytes());
      

       

       

      Without the SETFF command, there was a lot of white space after the png.

       

      Any help would be appreciated.

      Thank you

        • Re: Problem printing PNG on ZTC 140Xi4 / 140Xi3
          Karin Beck

          We have found a solution that seems to work for us: By setting the label length before printing the png, the label is printed correctly:

           

           

          String zplStart = "^XA";
          String setLabelLength = "^LL1120";
          String zplEnd = "^XZ";
          printer.getConnection().write(zplStart.getBytes());
          printer.getConnection().write(setLabelLength.getBytes());
          printer.printImage(filename, 0, 0, 944, 1120, true);
          printer.getConnection().write(zplEnd.getBytes());
          
            • Re: Problem printing PNG on ZTC 140Xi4 / 140Xi3
              Robin West

              Hi Karin,

              You are correct that the ^LL command is the correct one to use.

               

              The SETFF command is a CPCL command and the 140Xi4 does not take CPCL commands at all.  You were trying to combine CPCL commands and ZPL commands in your original post.  That generally won't work on printers, you want to stick to one print control language at a time.  The 140Xi4 by default only takes ZPL like you have in your second post.

               

              I have to ask, are you printing on sticky labels or a continuous roll of paper?  If it's labels, you might want to consider calibrating the printer so you don't have to worry about sending the label length.  You only have to send the following to the printer once ever, as long as you keep using the same type of labels.

              String calibrate = "^XA^MNA^XZ~JC";

               

              This will feed out a couple of labels, but then sit at the gap.  Prints from then on will always fill the label. You can condense your previous code to one line:

              printer.printImage(filename, 0, 0, 944, 1120, false); 

               

              Robin

                • Re: Problem printing PNG on ZTC 140Xi4 / 140Xi3
                  Karin Beck

                  Hi Robin,

                   

                  thank you for your fast answer!

                  We are printing on a continuous roll of paper.

                   

                  Primarily, we had used the command you mentioned above: printer.printImage(filename, 0, 0, 944, 1120, false);

                   

                  With this command, there were two issues:

                  1. Without storing the image on the printer Memory in advance, the label was cut off.
                  2. Storing the png in advance, there was added a lot of white space below the label.

                   

                  Regards

                  Karin