ZPL, Zebra OPOS, POS for .NET - zebra-printers

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?

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

How to print price without specyfing location of every part of the text? (ZPL)

The effect he wants to get is:
The price is normally printed
Near the price I want to print the rest of the price in superscript
At the end I want to place currency in subscript.
The problem is that I don't want to specify the location of every part of text.
^XA
^PW480
^FS
^JMA
^MMT
^LS0
^MTD
^CI28
^FO40,11
^FWN
^CF0,16.2,20.7
^FD2144
^FS
^CI28
^FO80,10
^FWN
^CF0,8,8
^FD00
^FS
^CI28
^FO100,10
^FWN^CF0,16.2,17.25
^FDEUR
^FS
^XZ
So the question is that possible to print text after text specifying location only once? Without specifying location to every part of the text?
Use ^FT instead of ^FO, and only specify the X coordinate for the first ^FT.
By default, ^FT resumes at the point where the previous formatting operation finished, and you can provide a manual override to the X and Y components separately, so you would only provide the Y override for the subsequent ^FTs and let it calculate the X automatically:
^FT40,11^A0,16.2,20.7^FD2144^FS
^FT,6^A0,8,8^FD00^FS
^FT,11^A0,16.2,17.25^FDEUR^FS
Note that you will need to adjust the Y coordinate down, because ^FO lines up with the top of the text line (letters hanging from it) and ^FT lines up with the bottom (letters standing on it).
Also note that ^CF changes the printer-wide default font, and there is no point to use it before each command. Use ^A instead as shown. You don't need to set ^CI before each command either, it is again a global setting for encoding of the entire label text.

Zebra: Printing Symbols with ZPL fails, Works with Designer

I'm trying to print some characters to my gk420d and hit a snag. I can't seem to print some necessary symbols. Some Examples: Ω, Θ (Omega, Theta). I can pull out an old windows machine, and have installed their software, updated the firmware to the latest and Put The following in a single text box on the designer [removed, i don't have enough rep]
When I print to file from the designer, using ZEBRA 0 Font (size 10), i get the following output (copied after opening from notepad++):
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR3,3~SD25^JUS^LRN^CI0^XZ
^XA
^MMT
^PW194
^LL0088
^LS0
^FO32,0^GFA,02304,02304,00024,:Z64:
eJzt1DFPAjEUAOB3BbkbSKg6SCIxhTgwmHjGxcGQQx00cSJxNRp/gB0Y2CykUQaG+wn+FBjcLsaRRQP/ADcGEm0LHO1xJjqQEPUNTe9LL/favnsASx2J3kGsW4B/5MhwmwEtZezBqICsl1oudMcDeowZcy4QcoNC6JgAtUD6ShLzcujrRAxs7KsI2NS3/ak7XHci/E762bx70pvNqFPpWeaf4IbpeWD1IvOPXG58l25leoOgM3zv1rzQN2Se4bJZ/tjwG/0c1AbGT5f6uekv/Mciwwagt5lE/zlnuiOK1/W5yx3TsShewhiOcRDuRL34CCCKKNZL8DCM+q5wAjxuPf3K96CBgyYz8yGySPu9atQ9OTJIRtxh8W7DxD9Mn0YqVn99eIv1zba8vU5/1G9D4g3s1Ou4PtOi+vbFbRPRdVAFbHTKVf+ULTUPPCsdusrLE5ctz5FutUSDjvo5g0RKuepDuiP0LaekzjGpKLd1z6/dz7wbKE9fiX2ln3qHE7d2qmXQ41rkmZST5Ly3lBd0JuJ8gCo3/l8Szv5ofS5ZfAI7QIrk:A7B6
^PQ1,0,1,Y^XZ
I don't understand a lot of that, it seems like the designer puts extra stuff in there different from the normal ZPL. I have been trying to get the Ω symbol to print directly from ZPL code, but I cannot work out how. I've tried several different combinations of the ^CI command and the hex code, but they all either print a different symbol or nothing at all.
^XA
^CI28
^FO10,45
^AB,16^FH
^FDOhm: _CE_A9
^FS
^XZ
How can I print the Ω symbol from straight zpl?

Text is printed incorrectly using ZPL

I print a text using ZPL but they are printed incorrectly. It has gaps in the middle. They are printed correctly to the real printer via the ZebraDesigner. But they are wrong when printing via ZPL:
^FT246,70^A0R,16,16
^FB900,2,,
^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
It is printed as 'Maisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi, Sojasprossen'
(there is a big gap after 'Mais,').
http://screencast.com/t/sTiaxC3cMg
http://screencast.com/t/0QkypnsPyF89
Please help.
Thanks
I'm unable to reproduce the issue, but the field block width seems rather large; you didn't specify any label dimensions in the original post. If you use the following code--a combination from the original post and your comments:
^XA
^PW560
^LL560
^LS0
^FO246,70^GB28,300,,^FS
^FT246,70^A0R,16,16 ^FB300,2,, ^FDMaisstaerke, Austernuce, Cashewnuss,Pilz, Mais, Lattich, Pack Choi,Sojasprossen^FS
^PQ1,0,1,Y
^XZ
I can reproduce what is possibly the issue--the field block automatic word wrapping--by reducing the field block width to 300 dots.
I also drew a box around the block for visualization. You can test in on the Labelary Viewer.
Finally, if you're somehow composing the data make sure there are no special (non printable, such as tab, non-UTF-8 or accented) characters in it, and if so, you will have to pre-escape them.

ZPL Barcode Labels setting width of label/barcode

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)...

Resources