Zebra iMZ320 image printing feeds too much paper
Asked Answered
L

2

5

I'm trying to use the Link-OS SDK to send images to a Zebra iMZ320 printer using the GraphicsUtil class in XCode for iOS.

-(void)printImage:(UIImage *)image{

    NSString *serialNumber = @"";
    EAAccessoryManager *sam = [EAAccessoryManager sharedAccessoryManager];
    NSArray * connectedAccessories = [sam connectedAccessories];
    for (EAAccessory *accessory in connectedAccessories) {
        if([accessory.protocolStrings indexOfObject:@"com.zebra.rawport"] != NSNotFound){
            serialNumber = accessory.serialNumber;
            break;
        }
    }
    self.connection = [[MfiBtPrinterConnection alloc] initWithSerialNumber:serialNumber];
    NSError *error = nil;

    BOOL success = [self.connection open];

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

    //Set the device language to zpl or the image prints its HEX value
    [SGD SET:@"device.languages" withValue:@"zpl" andWithPrinterConnection:self.connection error:&error];

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

    success = [graphicsUtil printImage:[image CGImage] atX:0 atY:0 withWidth:200 withHeight:200 andIsInsideFormat:NO error:&error];


}

The image prints correctly but the printer feeds about 9 inches of blank paper before printing the image. I tried to set the "media.tof" var to 0 and tried to send the SETFF 50 2 command, with no luck. Any hints ? Thanks!

Lau answered 15/10, 2013 at 14:45 Comment(5)
Xcode is just an IDE - are you talking about iOS or Mac OS X here ?Lunate
That would be for iOS.Lau
OK - I've added an iOS tag for you now - for future questions you might want to be clearer about the platform, since Xcode, as noted, is just an IDE.Lunate
@StephaneM. Could you please tell me how you printing the image using zebra printer. I am trying to download link-ios sdk but I can't. Can you also share the link if possibleThine
I am facing issue while black mark paper is used and the paper feeds some inches after black mark is encountered.Crowe
J
15

This is generally a Zebra printer configuration issue. Zebra printers can be set to either continuous mode (for printing receipts) or label mode (for printing labels). Furthermore, when set to label mode, the printer could be looking for a black bar to separate labels OR a gap in between the labels. So, the most important question is: what type of media are you using?

Continuous 'receipt' paper -

If you are using continuous paper, you will want to set the label length of your print job ahead of time. You will also want to indicate that you are using continuous media. You can send these commands to do so:

! U1 setvar "ezpl.media_type" "continuous"
! U1 setvar "zpl.label_length" "500"

Labels with black bars in between -

If you are using black bar labels, you need to send this SGD commands to the printer:

! U1 setvar "ezpl.media_type" "mark"

Labels with gaps in between -

If you are using labels with gaps in between, the following SGD command needs to be sent:

! U1 setvar "ezpl.media_type" "gap/notch"

(Notice the commands above are in ! U1 SGD notation. You can simply use the SDK 'SGD' calls as you see in your code to accomplish the same effect)

Justajustemilieu answered 15/10, 2013 at 23:12 Comment(4)
Got it working with the continuous media and label length. Thanks a lot !Lau
I am facing issue while black mark paper is used and the paper feeds some inches after black mark is encountered. FYI it is in Android. I have implemented this commandCrowe
Hello @StephaneM. how can I send commands to the printer? I have exactly the same problem that you had.Petrolatum
You can download 'Zebra Setup Utilities' - a program that will let you send commands to your printer over USB or Ethernet: zebra.com/us/en/products/software/barcode-printers/zebralink/…. If your printer is on the network, you can use putty and send commands to the printer directly to port 9100 (or 6101 if a mobile printer).Justajustemilieu
P
1

I can't comment but i have to add this here. As to the best of my knowledge the accepted answer is not a parameter that is saved in the printer. It will reset every time you power cycle the printer.

To have the above method working you need to send the setvar command each time you poweron and connect to your printer or it will be reset.

This is at least found to be true with Zebra iMZ220 running firmware V73.19.13Z (Currently the latest version).

I also noted that you can configure the media type with the Zebra Config Utility (v1.1.9.1122). Here under "Configure printer settings" you can set Journal/Black Mark/Gap sense. You can also setup the feed length after printing. BUT if you save the file and send it to the printer and have a look at the config file there are no config for the media type or feed length in there.

Zebra support has not yet been able to recognize they have a problem or point to a solution. :/

Perfidy answered 13/1, 2016 at 22:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.