ZPL Barcode Labels setting width of label/barcode - zpl

I'm printing to a zebra thermal printer from 2 different systems, a windows environment using BarTender to print labels with a text file as the data source, and an older system (green screen) which prints using command files like below.
My problem is when I print from the windows printer, the printers settings change, so when I then print from the other system, it loses the width and runs off the edge.
I tried to add a print width setting to the code below which didn't work ,^PW700 and could do with some advice! this isn't a language I know much about. I don't know if I used the code in the right way/place or if im using the right code at all? could it be that I need to use BYw?
^XA^LL456,^PW700^LH0,0^FS
^FO21,196^B3N,N,66,N^FDWU000208375^FS
^FO18,18^A0N,24,24^FDPrd Code : 84100705 ^FS
^FO18,48^A0N,24,24^FDDANDY GREY ^FS
^FO18,78^A0N,24,24^FDQuantity Remaining : 4.00^FS
^FO18,108^A0N,24,24^FDAmended : 01/07/15 Received : 01/07/15^FS
^FO18,138^A0N,24,24^FDBATCH : 241071 ^FS
^FO18,168^A0N,24,24^FD^FS
^FO129,276^A0N,24,24^FDW U 2 0 8 3 7 5
^XZ
Thanks in advance

It might be too late to answer this question, but it might help others.
The reason your code doesn't work might cause by comma before ^PW
^LL456,^PW700
So removing it should work on any system:
^LL456^PW700
The usual command code for zpl is
^(command)(parameter),(parameter)...

Related

ZPL code sent to printer prints 2 blank labels before printing the actual label

The following ZPL code when sent to a Zebra GX-420D printer with 2"x2" labeld loaded, does 2 very strange things:
Skips the first 2 labels and only prints on the 3rd one
Repeat this (2 blank labels + one with content) one more time, after a short delay.
So in total it uses 6 labels, and the content is only on the 3rd and 6th one.
Here's the code:
^XA
^FX Test for long barcode
^BY1,2,50
^FO20,10^BC^FD>6UIQ-2013P-MR-BU^FS
^XZ
Is there anything in the above code that would cause this phenomenon?
^FS at the end of a commented text is optional.
From ZPL II manual :
The ^FS command denotes the end of the field definition.
Alternatively, ^FS command can also be issued as a single ASCII control code SI (Control-O, hexadecimal 0F).
I eventually figured it out. I was trying to remotely fix this, not having a direct access to the printer and not seeing what it printed and how. But eventually I got access to a printer and then it didn't take long to fix.
It seems that there were some defaults or setting left over from the previous print jobs that cause the problem. I added some resetting of values in front of the printing and after that it properly printed out just one label.
And yes, the ^FS was not needed at the end of the comment with ^FX.
Here is the code that printed out the same thing correctly (there might be some unnecessary commands but this one worked so I left it at that):
^XA~TA000~JSN^MNW^PON^PMN^LH0,000~SD15^XZ
^XA^JUS^XZ
^XA
^MMT
^PW0355
^LL0305
^FX Test for long barcode
^BY1,2,50
^FO20,10^BC^FD>6UIQ-2013P-MR-BU^FS
^XZ

A0N size is different than expected when printed

I have a strange problem. I got a new ZT220 printer (203 dpi - 8dpmm) and when I use simple A0N sizing to adjust font it prints font of incorrect size.
For example a simple code:
^XA
^A0N,80^FO80,80^FD1^FS
^XZ
Should print number 1 exactly 1 centimeter tall (80 / 8 = 10mm), yet it comes out at around 7mm. Any advice?
When I print a graphic, for example a box:
^XA
^FO80,80^GB80,80,1,B,0^FS
^XZ
This box comes out precisely 10x10mm.
Why is it that the font doesn't scale properly?
Note that I'm new to ZPL and this is my first Zebra printer. I use Ubuntu environment to send files to print, e.g.:
lpr -P <printer name> -o raw text.zpl
All I did was connect the printer through CUPS. Do I have to install the default fonts? If yes how do I do that on Ubuntu?
The space for characters is what you are specifying. Not all characters take up the full space. For example a lower case 'g' or 'p' would go below the bottom of the '1' character.
Also, different fonts may act differently. Try below to see how differently some behave.
^XA
^A0N,80^FO80,100^FD1gpi|0^FS
^FO80,100^GB400,80,1,B,0^FS
^A1N,80^FO80,200^FD1gpi|0^FS
^FO80,200^GB400,80,1,B,0^FS
^AbN,80^FO80,300^FD1gpi|0^FS
^FO80,300^GB400,80,1,B,0^FS
^AcN,80^FO80,400^FD1gpi|0^FS
^FO80,400^GB400,80,1,B,0^FS
^AeN,80^FO80,500^FD1gpi|0^FS
^FO80,500^GB400,80,1,B,0^FS
^AfN,80^FO80,600^FD1gpi|0^FS
^FO80,600^GB400,80,1,B,0^FS
^XZ

How do I change the Zebra ZP 450 left position with OS X?

Please Help! I'm trying to print to a 1.5"x1.0" label on a Zebra ZP 450. The printer is connect to a Mac. When I print the label the printout is way over to the left. Only as small part of the bar code print out on the left side of the label. I'm guessing this is cause by the 'left position' in the printer settings. I tried calibrate (two flash and four flash) with no luck. I tried using zebrasetuputil app also with no luck (don't may not know enough of the programming to write it correctly).
Is there a terminal command I could use to change the default left position setting within the printer?
Sorry I'm new to all of this. Any help would be great!
OSX 10.11.1
Zebra ZP 450
Label Size: 1.5"x1.0"
Send this command to the printer:
^XA^LS0^XZ
^XA Starts the format (always required)
^LSa sets the offset where a = offset
^XZ End format (always required)
See the ZPL Programming Guide
Additionally, there is a command you can set to prevent other labels from setting these offsets. (Sorry, don't know off the top of my head) It's a very good idea because ideally these offset should only be used for printers that are exhibiting wear, and need an offset to account for physical differences.
Using it for label formats will cause all sorts of problems with label formats that don't set it, because the labels that do set it will cause the ones that don't to be offset.

Zebra RW 420 not printing last or first inch using ZPL

Zebra RW 420 not printing last or first inch(depending on rotation) using ZPL.
this link was suppose to give a solution since it is the same symptom; but I've try all combinations of "Back Feed" (~JSN, ~JSA, ~JSB) with no results.
here is my ZPL code(generated from ZebraDesigner print to file command) It doesn't print "Hello 22" completely:
^XA~TA000~JSN^LT0^MNM^MTT^POI^PMN^LH0,0^JMA^PR2,2~SD10^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL2233
^LS0
^FO272,76^A0N,56,55^FH\^FDHello 11^FS
^FO320,2000^A0N,56,55^FH\^FDHello 22^FS
^PQ1,0,1,Y^XZ
I had the same problems with print output. I ended up abandoning use of ^FO and went with ^FT, and everything has been perfect since. I don't know why ^FO is so temperamental, but ^FT is very straightforward. You get what you expect.
I'd suggest getting rid of that entire first row that ZebraDesigner made. You don't need it.
I've solved the problem with the help of Zebra support.
The actual problem was the var "zpl.label_length" that was set to 2014 instead of 2233; the ^LL command is ignored in this printer and the label length is controlled only by "zpl.label_length".
It printed the whole label(11")after sending the command:
! U1 setvar "zpl.label_length" "2233"

ZPL, Zebra OPOS, POS for .NET

I have ZPL code as follows:
^XA^CI27^LH0,0^BY2^FO250,50^B3N,N,25,N,N^FDU0772287 ^FS
^FO30,50^A0N,35,35^FD$9.99 ^FS
^FO200,80^A0N,25,25^FH^FDBatch 14657, Item 772287K, 2013-May-29 ^FS
^FO30,115^A0N,25,25^FH^FDAccessories for stroller/carseat, Acton ^FS
^FO550,145^A0N,25,25^FH^FDSize: Preschool ^FS
^FO30,145^A0N,25,25^FH^FDDenim, Maternity ^FS^XZ
When sending it to my Zebra GK420d via POS for .NET & Zebra OPOS, this label ends up taking two 4 inch x 1 inch labels instead of just one. Only one line prints on the second label. There is more than enough room on the label to print this text.
Remove the ^CI27 and the ^FH and you will not see this behaviour.
Remove almost any one of the individual pieces of text and you will not see this behaviour.
Change the label at 200,80 to start at 30,80 and you won't see this behaviour.
Change Acton to say Act and you won't see this behaviour.
However, in some of the above scenarios, although it prints on one label, you'll sometimes discover a ^FS appear somewhere, in the standard font (smaller than ^A0N,25,25). In the last variant (and a bunch of others), you'll end up with the end of one of the lines of text written, in the default font, overwriting the start of another line. You'll also sometimes see a ^FS appear in the middle of nowhere.
Because I see this bug with only some textual strings and not others, I suspected some kind of layout bug due to font size calculations, so I tried changing all the text on the label to a W or an I and it does not make any difference.
I'm stumped; this makes no sense to me and it doesn't follow the documentation I have seen online. Furthermore, everything explodes (fonts are ignored, text is overwritten, prints on four stickers, etc.) when:
a linebreak (Windows) is not put after every ^FS
a linebreak is put anywhere else
a space is not put before every ^FS
Do I have a bug in my ZPL? Am I finding a weird bug in the Zebra OPOS library or POS for .NET? Is it just my printer?

Resources