Printing stability


Hi,

 

I have a problem with printing stability using QLn 320 Zebra with firmware V68.19.7Z from iOS application.

I use Zebra SDK and print code is:

 

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {

        // Instantiate connection to Zebra Bluetooth accessory

        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

        NSString *serialNumber = [defaults valueForKey:@"selectedPrinterSN"];

        id<ZebraPrinterConnection, NSObject> thePrinterConn = [[MfiBtPrinterConnectionalloc] initWithSerialNumber:serialNumber];

       

        BOOL success = [thePrinterConn open];

       

        NSString *zplData = [NSString stringWithFormat:

                             @"^XA" \

                             @"^LH20,20^POI" \

                             @"^FT5,5^FH^A0N,30,30^FD%@^FS" \

                             @"^FT5,45^FH^A0N,30,30^FD%@^FS" \

                             @"^XZ" \

                             , @“Line1”, @“Line2”];

       

        NSError *error = nil;

        NSMutableData *data = [[zplData dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];       

       

        long blockSize = 1024;

        long totalSize = data.length;

        long bytesRemaining = totalSize;

        while (bytesRemaining > 0) {

            long bytesToSend = MIN(blockSize, bytesRemaining);

            NSRange range = NSMakeRange(0, bytesToSend);

           

            NSData *partialLabel = [data subdataWithRange:range];

            [thePrinterConn write:partialLabel error:&error];

           

            bytesRemaining -= bytesToSend;

           

            [data replaceBytesInRange:range withBytes:NULL length:0];

            if (error) {

                break;

            }

        }

 

        [thePrinterConn close];

       

        dispatch_async(dispatch_get_main_queue(), ^{

              //Update UI on the main queue!

        });

    });

 

There is a button “Print Label” on UI that triggers label printing.

Sometimes label is not printed (about 1 label of 10 attempts) without any errors from MfiBtPrinterConnection.

I tried to change timeout but this didn’t help.

[((MfiBtPrinterConnection*)thePrinterConn) setTimeToWaitAfterWriteInMilliseconds:30];

 

Could you advice how to find the reason of that (get logs from printer or something different)?

Anonymous (not verified)
Hello Dmitrij,The data that

Hello Dmitrij,

The data that you are trying to print, is it all text or is there images in it? If it is just text is there alot of text? Depending on what you are sending down to print you may need to make the timeout higher than 30.

Also, you are using V68.19.7Z firmware which is no longer the latest firmware, please download the latest firmware here and see if the issue persists.

Thank you,

Beverly

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dmitrij Burakov...
Hi Beverly,Thank you for your

Hi Beverly,

Thank you for your reply.

We print just text, maximum 5 lines on label 40x20 mm.

We try to upgrade the firmware and I will inform about the results.

Dmitrij

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dmitrij Burakov...
Hi Beverly,We have updated

Hi Beverly,

We have updated the firmware but there are no result. The printing is the same.

What can we try more?

Kind regards

Dmitrij Burakov

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Dmitrij,There is a new

Hi Dmitrij,

There is a new version of the SDK available, please download it and see if the issue persists. It appear many people are seeing the same or a similar issue so I am working to replicate and test code etc. here. I will let you know what I find out.

What version of Xcode are you running? What iOS device and iOS version are you using? I want to gather this data to compare the issues between users and with what I am testing with.

Thank you,

Beverly

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Dmitrij,I tested your code

Hi Dmitrij,

I tested your code but changed this line:

   NSString *zplData = [NSString stringWithFormat:

                             @"^XA" \

                             @"^LH20,20^POI" \

                             @"^FT5,5^FH^A0N,30,30^FD%@^FS" \

                             @"^FT5,45^FH^A0N,30,30^FD%@^FS" \

                             @"^XZ" \

                             , @“Line1”, @“Line2”];

to this:

  NSString *zplData = [NSString stringWithFormat:

                             @"^XA^LH20,20^POI^FT5,5^FH^A0N,30,30^FD%@^FS^FT5,45^FH^A0N,30,30^FD%@^FS^XZ",@"Line1", @"Line2"];


I was able to get it to print consistently. I am running Xcode
Version 7.1.1 (7B1005), using an iPad with iOS 9.1 (13B143). I was testing with the latest SDK and FW on my printer.

Please try updating your app to use the latest SDK (see my previous post with link to updated file) and modifying the NSString *zplData line and let me know what happens.

Thank you,

Beverly

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Dmitrij Burakov...
Hi Beverly,I use the same

Hi Beverly,

I use the same Xcode version 7.1.1 (7B1005) and iPad with iOS version that I have to specify with my customer.

I will try to update SDK and inform you about results (it could take few days).

Thank you for your support.

Kind regards

Dmitrij Burakov

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Dmitrij,OK thank you,

Hi Dmitrij,

OK thank you, please also be sure to test the updated *zplData string.

Thank you,

Beverly

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Dmitrij,Were you able to

Hi Dmitrij,

Were you able to test out the code with the updated SDK and updated *zplData string? Did it resolve the issue?

Thank you,

Beverly

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


jofin george
Hi Beverly,I have an urgent

Hi Beverly,

I have an urgent requirement to convert image or pdf file used for printing in zebra imz320 printer  to cpcl format. can you please help me on this with some sample code.

My requirement

Image.png/image.jpg/imf.pdf   ----- > content.txt (this contain cpcl commands converted from image or pdf file eg : ! 0 200 200 210 1 TEXT 4 0 30 40 Hello World FORM PRINT )

Any help is appreciated

Thanks

Jofin

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments