12 Replies Latest reply on Dec 8, 2015 7:12 AM by Robin West

    Image printing

    Jeffrey 2amdbpw9sauic1bf5yqbsftsex7zt2z0,Lee

      To print images on the ZQ510, I use the following:

       

      Store images

       

      // Store the BSS image on the printer
      image = [UIImage imageNamed:@"bss-train-logo-v2.png"];
      [graphicsUtil storeImage:@"BSS_V2" withImage:[image CGImage] withWidth:image.size.width andWithHeight:image.size.height error:&error];
      
      // Store the Cemetery image on the printer
      image = [UIImage imageNamed:@"cemetery-tour-logo-v3.png"];
      [graphicsUtil storeImage:@"CEMETERY_V3" withImage:[image CGImage] withWidth:image.size.width andWithHeight:image.size.height error:&error];
      NSLog(@"Cemetery Image Error: %@", error);
      

       

      Recall Images

       

      printString = [NSString stringWithFormat:@"%@^FO50,%ld^XGE:%@.GRF,1,1^FS", printString, length, @"BSS_V2"];
      length += 75;
      
      printString = [NSString stringWithFormat:@"%@^FO50,%ld^XGE:%@.GRF,1,1^FS", printString, length, @"CEMETERY_V3"];
      length += 160;
      
      

       

      Sometimes, the images print perfectly. Other times (about 25-50%), one or both of the images does not print. The rest of the receipt is printed as expected. Any ideas?

        • Re: Image printing

          Hi Jeffrey,

           

          Thank you for sharing your code. Let me take a look at your code and some documentation here and I will get back to you with next steps.

           

          Thank you,

          Beverly

            • Re: Image printing
              Jeffrey 2amdbpw9sauic1bf5yqbsftsex7zt2z0,Lee

              Thanks, Beverly. Please let me know if I can provide anything to help troubleshoot this. We are anxious to test these printers in the field.

              • Re: Image printing
                Jeffrey 2amdbpw9sauic1bf5yqbsftsex7zt2z0,Lee

                Has any progress been made on this issue? Is there a way to escalate it?

                  • Re: Image printing

                    Jeff,


                    I have been looking at your code and was trying to replicate it here on my laptop.

                     

                    For this line: printString = [NSString stringWithFormat:@"%@^FO50,%ld^XGE:%@.GRF,1,1^FS", printString, length, @"BSS_V2"];  


                    My understanding of what is happening is that "BSS_V2" is substituted in for the %@ for the image name in XGE, and length for the %1d, which would be the y-axis on the field origin command, I am assuming length is a long variable declared elsewhere. The printString variable is substituted at the beginning of the format %@ before the ^FO command correct? What does printString contain?

                     

                    Could you share with me what data printString contains and also the line of code where you send printString down to the printer to be printed?

                     

                    Are these images being printed above the rest of the receipt data, at the bottom or somewhere in the middle?

                     

                    Thank you,

                    Beverly

                      • Re: Re: Image printing
                        Jeffrey 2amdbpw9sauic1bf5yqbsftsex7zt2z0,Lee

                        This gist (Zebra ZQ510 Print Job · GitHub) shows the full code for that. You can also find the string being sent to the printer below in my debug output.

                         

                        It's important to note that I can send the same exact string and get different results -- sometimes the image(s) print and sometimes not.

                         

                        This line

                         

                        printString = [NSString stringWithFormat:@"%@^FO50,%ld^XGE:%@.GRF,1,1^FS", printString, length, @"BSS_V2"];
                        

                         

                        is appending something like "^FO50,160^XGE:HOHO_V4.GRF,1,1^FS" to the printString and setting the Y position (which is a long) and image name accordingly. The printString is built up with other data but at that point in the process it's pretty basic:

                         

                        // Spacing and length
                        int leftSpacing;
                        long length = 0;
                        NSString *padding;
                        
                        // Start of print
                        NSString *printString = @"^XA^POI^PW576^MNN^LL%d^LH0,0";
                        
                        // Start off with 10 dots of padding
                        length += 10;
                        
                        NSString *imageName = @"LOGO_V5";
                        printString = [NSString stringWithFormat:@"%@^FO50,%ld^XGE:%@.GRF,1,1^FS", printString, length, imageName];
                        length += 150;
                        

                         

                        When calling the - (BOOL)printTickets:(Order *)order method, the following occurs.

                         

                        This attempt DID NOT print the HOHO_V4.GRF graphic:

                         

                        2015-11-04 15:16:18.835 ApplicationPOS[5489:464702] Unable to get scanner info!
                        2015-11-04 15:16:18.842 ApplicationPOS[5489:464702] Zebra mobile printer connected!
                        2015-11-04 15:16:18.939 ApplicationPOS[5489:466731] [PRINT STRING]: ^XA^POI^PW576^MNN^LL1135^LH0,0^FO50,10^XGE:LOGO_V5.GRF,1,1^FS^FO50,160^XGE:HOHO_V4.GRF,1,1^FS^A2,N,22^FO20,310^FD       Wed Nov  4^FS^A2,N,22^FO20,350^FD       Thu Nov  5^FS^A2,N,22^FO20,390^FD       Fri Nov  6^FS^A2,N,22^FO20,455^FD        1 Adult^FS^FO100,520^B7N,8,5,7,14,N^FDCSS-061-151104210702731^FS^A2,N,12,12^FO20,660^FDTERMINAL 061           11/04/2015 15:07:02 PM^FS^A2,N,12,12^FO20,685^FDOrder Number:         CSS-061-151104210702731^FS^A2,N,12,12^FO20,735^FD       Present Ticket to Bus Operator.^FS^A2,N,12,12^FO19,735^FD       Present Ticket to Bus Operator.^FS^A2,N,12,12^FO20,736^FD       Present Ticket to Bus Operator.^FS^A2,N,12,12^FO20,760^FD   All Passengers must remain seated when^FS^A2,N,12,12^FO20,785^FD   vehicle is in motion. No standing room.^FS^A2,N,12,12^FO20,810^FDSmoking, Eating, Drinking Alcoholic Beverages^FS^A2,N,12,12^FO20,835^FD         is prohibited on vehicles.^FS^A2,N,12,12^FO20,860^FDRoute, Stops and Timing are subject to change^FS^A2,N,12,12^FO20,885^FD   All sales are final. Non-transferable.^FS^A2,N,12,12^FO20,910^FD          No refunds. No exchanges.^FS^A2,N,12,12^FO20,935^FD                 THANK YOU!^FS^A2,N,12,12^FO20,1035^FD ----------------------------------------------^FS^XZ
                        2015-11-04 15:16:19.257 ApplicationPOS[5489:466731] ERROR: (null)
                        2015-11-04 15:16:19.264 ApplicationPOS[5489:466731] Printing receipt...
                        2015-11-04 15:16:19.529 ApplicationPOS[5489:466731] ZEBRA: Language error: (null)
                        2015-11-04 15:16:20.508 ApplicationPOS[5489:466731] ZEBRA: Connection error: (null)
                        2015-11-04 15:16:22.308 ApplicationPOS[5489:466731] ZEBRA: Graphics error: (null)
                        2015-11-04 15:16:22.315 ApplicationPOS[5489:466731] [PRINT STRING]: ^XA^POI^PW576^MNN^LL695^LH0,0^FO50,10^XGE:LOGO_V5.GRF,1,1^FS^A2,N,24,24^FO30,160^FD   RECEIPT ONLY^FS^A2,N,12,12^FO20,220^FDTERMINAL 061           11/04/2015 15:07:02 PM^FS^A2,N,12,12^FO20,245^FDOrder Number:         CSS-061-151104210702731^FS^A2,N,12,12^FO20,295^FDAdult (1 @ $39.00)                     $39.00^FS^A2,N,12,12^FO20,370^FDTOTAL                                  $39.00^FS^A2,N,12,12^FO19,370^FDTOTAL                                  $39.00^FS^A2,N,12,12^FO20,371^FDTOTAL                                  $39.00^FS^A2,N,12,12^FO20,420^FDCASH                                   $40.00^FS^A2,N,12,12^FO19,420^FDCASH                                   $40.00^FS^A2,N,12,12^FO20,421^FDCASH                                   $40.00^FS^A2,N,12,12^FO20,445^FD  Transaction ID:        56705d0d35835d0f120d^FS^A2,N,12,12^FO20,495^FDCHANGE:                                 $1.00^FS^A2,N,12,12^FO19,495^FDCHANGE:                                 $1.00^FS^A2,N,12,12^FO20,496^FDCHANGE:                                 $1.00^FS^A2,N,12,12^FO20,545^FD   All sales are final. Non-transferable.^FS^A2,N,12,12^FO20,570^FD          No refunds. No exchanges.^FS^A2,N,12,12^FO20,595^FD                 THANK YOU!^FS^XZ
                        2015-11-04 15:16:22.626 ApplicationPOS[5489:466731] ERROR: (null)
                        

                         

                        This attempt DID print the HOHO_V4.GRF graphic.

                         

                        2015-11-04 15:18:48.835 ApplicationPOS[5489:464702] Unable to get scanner info!
                        2015-11-04 15:18:48.842 ApplicationPOS[5489:464702] Zebra mobile printer connected!
                        2015-11-04 15:18:48.880 ApplicationPOS[5489:467262] [PRINT STRING]: ^XA^POI^PW576^MNN^LL1135^LH0,0^FO50,10^XGE:LOGO_V5.GRF,1,1^FS^FO50,160^XGE:HOHO_V4.GRF,1,1^FS^A2,N,22^FO20,310^FD       Wed Nov  4^FS^A2,N,22^FO20,350^FD       Thu Nov  5^FS^A2,N,22^FO20,390^FD       Fri Nov  6^FS^A2,N,22^FO20,455^FD        1 Adult^FS^FO100,520^B7N,8,5,7,14,N^FDCSS-061-151104210702731^FS^A2,N,12,12^FO20,660^FDTERMINAL 061           11/04/2015 15:07:02 PM^FS^A2,N,12,12^FO20,685^FDOrder Number:         CSS-061-151104210702731^FS^A2,N,12,12^FO20,735^FD       Present Ticket to Bus Operator.^FS^A2,N,12,12^FO19,735^FD       Present Ticket to Bus Operator.^FS^A2,N,12,12^FO20,736^FD       Present Ticket to Bus Operator.^FS^A2,N,12,12^FO20,760^FD   All Passengers must remain seated when^FS^A2,N,12,12^FO20,785^FD   vehicle is in motion. No standing room.^FS^A2,N,12,12^FO20,810^FDSmoking, Eating, Drinking Alcoholic Beverages^FS^A2,N,12,12^FO20,835^FD         is prohibited on vehicles.^FS^A2,N,12,12^FO20,860^FDRoute, Stops and Timing are subject to change^FS^A2,N,12,12^FO20,885^FD   All sales are final. Non-transferable.^FS^A2,N,12,12^FO20,910^FD          No refunds. No exchanges.^FS^A2,N,12,12^FO20,935^FD                 THANK YOU!^FS^A2,N,12,12^FO20,1035^FD ----------------------------------------------^FS^XZ
                        2015-11-04 15:18:49.205 ApplicationPOS[5489:467262] ERROR: (null)
                        2015-11-04 15:18:49.211 ApplicationPOS[5489:467262] Printing receipt...
                        2015-11-04 15:18:49.485 ApplicationPOS[5489:467244] ZEBRA: Language error: (null)
                        2015-11-04 15:18:50.470 ApplicationPOS[5489:467244] ZEBRA: Connection error: (null)
                        2015-11-04 15:18:52.274 ApplicationPOS[5489:467244] ZEBRA: Graphics error: (null)
                        2015-11-04 15:18:52.281 ApplicationPOS[5489:467244] [PRINT STRING]: ^XA^POI^PW576^MNN^LL695^LH0,0^FO50,10^XGE:LOGO_V5.GRF,1,1^FS^A2,N,24,24^FO30,160^FD   RECEIPT ONLY^FS^A2,N,12,12^FO20,220^FDTERMINAL 061           11/04/2015 15:07:02 PM^FS^A2,N,12,12^FO20,245^FDOrder Number:         CSS-061-151104210702731^FS^A2,N,12,12^FO20,295^FDAdult (1 @ $39.00)                     $39.00^FS^A2,N,12,12^FO20,370^FDTOTAL                                  $39.00^FS^A2,N,12,12^FO19,370^FDTOTAL                                  $39.00^FS^A2,N,12,12^FO20,371^FDTOTAL                                  $39.00^FS^A2,N,12,12^FO20,420^FDCASH                                   $40.00^FS^A2,N,12,12^FO19,420^FDCASH                                   $40.00^FS^A2,N,12,12^FO20,421^FDCASH                                   $40.00^FS^A2,N,12,12^FO20,445^FD  Transaction ID:        56705d0d35835d0f120d^FS^A2,N,12,12^FO20,495^FDCHANGE:                                 $1.00^FS^A2,N,12,12^FO19,495^FDCHANGE:                                 $1.00^FS^A2,N,12,12^FO20,496^FDCHANGE:                                 $1.00^FS^A2,N,12,12^FO20,545^FD   All sales are final. Non-transferable.^FS^A2,N,12,12^FO20,570^FD          No refunds. No exchanges.^FS^A2,N,12,12^FO20,595^FD                 THANK YOU!^FS^XZ
                        2015-11-04 15:18:52.593 ApplicationPOS[5489:467244] ERROR: (null)
                        

                         

                        If you compare the print strings in each, they are exactly the same. Aside from the graphic not printing, the two prints are identical coming out of the printer. It's as if the printer just skips over images randomly. It's not always the same image that gets skipped either.

                        • Re: Image printing
                          Jeffrey 2amdbpw9sauic1bf5yqbsftsex7zt2z0,Lee

                          Hi Beverly,

                           

                          I was wondering if there was any progress made on this issue. Please let me know if I can provide any other information or if phone support is an option.

                           

                          Thanks,

                          Jeff