"Error writing to connection" on ZQ520 printer

Hi everybody,

thank you for the great work you always do.

 

I'm developing an iOS application that create a pdf, saving in device and then print with the Zebra ZQ520 printer.

I'm connected to the printer with an Ipad 10.3 and I'm able to print pdfs from the Ipad with your SDK application.

Before i execute [graphicsUtil printImage:[image CGImage]atX:0 atY:0 withWidth:-1 withHeight:-1 NO error:&error]; i check if the connection to the print is still open.

When i call the function printImage from graphicsUtil i received an error: Error Domain=ZSDK_API_ERROR_DOMAIN Code=1 "Error writing to connection".

 

In attachments the ALLCV, the printer config, an HH report from the printer, the screenshot of the error.

 

Best reguards, waiting for answer.

 

Luca

Luca Tomasetti
I'm still waiting for an

I'm still waiting for an answer because I'm stuck on this problem.

If you need anything else let me know.

Luca

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Samantha Corn
Hi Luca,How are you doing the

Hi Luca,

How are you doing the printer connection? Bluetooth, Bluetooth LE, Wi-Fi?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luca Tomasetti
Hi Samantha,I'm connected to

Hi Samantha,

I'm connected to the printer via Bluetooth.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Luca, Just so we know

Hi Luca, Just so we know where to start looking, were you able to use the developer demos (sample code installed with the SDK) on the same Ipad to print over Bluetooth to that printer?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luca Tomasetti
Hi Robin, Yes with the

Hi Robin, Yes with the developer demos I'm able to print on that same Ipad over bluetooth on that printer.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Also, If you substitute it

Also, If you substitute it with the printImage function, what happens.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luca Tomasetti
If I understand correctly, I

If I understand correctly, I've already tried this solution and in the developer demos the Ipad was printing well.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Luca,How are you creating

Hi Luca,

How are you creating the 'graphicUtil' instance? I'm wondering if the issue is something to do with how you created the ZebraPrinter object.  That is often an issue.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luca Tomasetti
Hi Robin,these are the lines

Hi Robin,

these are the lines of code for the creation of my graphicUtil and its utilization:

id<GraphicsUtil, NSObject> graphicsUtil = [printer getGraphicsUtil];

where printer is an instance of a bluetooth connection:

printer = [ZebraPrinterFactory getInstance:connection error:&error];

and this is the line of code where i use graphicUtil:

success = [graphicsUtil printImage:[image CGImage] atX:0 atY:0 withWidth:-1 withHeight:-1

                                             andIsInsideFormat:NO error:&error];

where image is:

CFURLRef pdfURL = (CFURLRef)[NSURL URLWithString:self.path];

CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);

UIImage* image = [self imageFromPDF:pdf page:pageNum];

self.path is the path of the my pdf saved in the device; pageNum is a number in a loop of all the pdf's pages

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Luca,I'm going to cover

Hi Luca,

I'm going to cover several things to try:

1. Do you have the info.plist including the external accessory protocol string?

<key>UISupportedExternalAccessoryProtocols</key>

<array>

<string>com.zebra.rawport</string>

</array>

2. instead of the line:

success = [graphicsUtil printImage:[image CGImage]...

Can you put in:

NSString *zplData = @"^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";

success = [thePrinterConn write:[zplData dataUsingEncoding:NSUTF8StringEncoding] error:&error];

and tell me what happens?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luca Tomasetti
Hi Robin, 1. Yes I've got the

Hi Robin,

1. Yes I've got the external accessory protocol included in my info.plist.

2. At the moment I' not able do perform the action because I don't have the printer with me, I'll try next week.

In the meantime is there anything else I can try? Or is there anything I can check if is it correct or not?

Thank you,

Luca

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Luca Tomasetti
this is what it happens when

this is what it happens when I put the:

NSString *zplData = @"^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";

success = [thePrinterConn write:[zplData dataUsingEncoding:NSUTF8StringEncoding] error:&error];

IMG-20170914-WA0018.jpg

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments