6 Replies Latest reply on Apr 19, 2016 1:02 PM by Aditya Garg

    Why does Zebra shrink the page?

    Aditya Garg

      I have been trying to use the ZD500 with LinkOS to develop and iOS for sort of label printing. Couple of things I was hoping someone can shed some light on

      1) I see the printer keeps shrinking my input PDF. To print on a 4" wide x 3" high label roll, I need to provide a US Letter size page which the printer shrinks to the 4x3 size. When I provide a 4x3 pdf, the output is a stamp size print on my 4x3 paper. Why does that happen? If there a piece of code doing that I can remove? Some printer config I can change?

       

      2) My ZD500 comes with a auto-cutter. Currently I believe it chops off the the label based on a small gap between 2 consecutive labels. But I want to be able to use a simple continuous label and be able to cut the label based on code, or at least based on some printer configuration. Is that possible?

        • Re: Why does Zebra shrink the page?
          Manuel Caicedo-Rivera

          Hi Aditya,

           

          How are you rendering your PDF? Is it a PDF virtual device downloaded and activated on your ZD500?  Is it your own rendering? If so, are you converting to image?

          Please, let us know a little more about it.

           

          Thanks,

           

          MC

            • Re: Why does Zebra shrink the page?
              Aditya Garg

              Hi Manuel

              This is PDF at some URL on a server. Using iOS NSURLConnection I download the PDF to NSData format. Then using the sdk methods for LinkOS iOS I try to print this. Most of those steps are from PrintPreviewController provided in LinkOS sdk. 2 main methods being...

              sendImageToPrinter - obtain graphicsUtil object for the printer

              printPDF:(id<GraphicsUtil, NSObject>) graphicsUtil - I modified this a little to take NSData instead of URL String.

              Convert NSData to CFDataRef to CGDataProviderRef to CGPDFDocumentRef.

              Once a CGPDFDocumentRef object is obtained, its the same function.

              Take each page (in my case, its always 1 page), use

              [self imageFromPDF:pdf page:pageNum]

              which was provided in the class in the SDK to get an image and  once you have the image, use

              [graphicsUtil printImage:[image CGImage] atX:0 atY:0 withWidth:-1 withHeight:-1 andIsInsideFormat:NO error:&error];

              to send image to printer.

               

              Please let me know if you need more details

                • Re: Why does Zebra shrink the page?
                  Manuel Caicedo-Rivera

                  Hi Aditya,

                   

                  I do not know if you already tried the following suggestion. You can modify the size of the image in the command that you are using

                   

                  [graphicsUtil printImage:[image CGImage] atX:0 atY:0 withWidth:-1 withHeight:-1 andIsInsideFormat:NO error:&error];

                   

                  by Modifying withWidth and withHeight parameters to cover the dimensions of the size of the label.

                   

                  Please, let us know if this suggestion worked for you.

                   

                  Thanks,

                   

                  MC

                    • Re: Why does Zebra shrink the page?
                      Aditya Garg

                      I have not changed these Manuel. The reason I didn't fiddle with these values is because the documentation says

                      * @param width Desired width of the printed image. Passing -1 will preserve original width.

                      * @param height Desired height of the printed image. Passing -1 will preserve original height.

                      This made me believe that my original page size should be maintained. So my 4x3 PDF should print normally instead of stamp size.
                      Can you suggest what sort of values can I try for these? The X and Y values are supposed to be in dots, but since we are talking about printing and not display on iPad, I am not clear what values I should use to come up with a 4" x 3" values.

                        • Re: Why does Zebra shrink the page?
                          Manuel Caicedo-Rivera

                          Hi Aditya,

                           

                          We think that you can solve this in two different ways.

                           

                          1.) If you have control with your PDF converter, it should come by default to delimit the printing to the standard 8.5" x 11. If you can modify these dimensions to 4x3 PDF, maybe, the printing output would be what you expect.

                           

                          2.) Your thoughts about original width and height are correct, however, you are able to use your own dimensions if you wants to make it bigger and cover the area you want to cover for the printing output.

                           

                          Regarding your second question, please, use the ZPL command to cut after printing. Review our ZPL programming guide in page 297 (link below). The command ^MM will help you to cut your label after printing.  You will need to add a new line code to send this command after the PDF image was sent for printing.

                          https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf

                           

                          Thanks,

                          MC

                           

                          Link-OS printers, such as ZD500, have an option to active a virtual device that works as a PDF printer. More info on the links below.

                          PDF Printing

                          Zebra Technologies - PDF Printing through Link-OS PDF Virtual Device

                            • Re: Why does Zebra shrink the page?
                              Aditya Garg

                              Thanks Manuel

                              I did try printing a 4x3 document as i mentioned in my original post. It comes out stamp sized on my 4x3 physical label. And hence the width and height has perplexed me. Since my original PDF was 4x3 and so was my paper, the width and height of -1 should have printed my label just fine.

                              As a matter of fact, I tried the demo code base that comes with the SDK (an iPhone app). That has a PDF in its bundle, which is also US letter size pages, but on printing, the output in shrunk down to try to squeeze onto the small 4x3 label.

                               

                              thanks for the paper cutting command. I will go through the ZPL programming guide as well.