Zebra: Printing Symbols with ZPL fails, Works with Designer - zebra-printers

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?

Related

ZebraDesigner - Saving zpl code does not actually save code as zpl

title might be a bit weirdly formulated, so let me try to explain:
I use ZebraDesigner 3 Essentials in order to make a label. I then "print to file", which leaves me with a .prn containing code. I also tried the answer from this question:
How to get ZPL code from a ZebraDesigner label?
, leaving me with a .zpl file, which has the same content as the .prn file.
That content is similiar to zpl, but it seemingly is not the same. This is the result of a simple label, where "Text" is in the middle of it:
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR2,2~SD20^JUS^LRN^CI0^XZ
^XA
^MMT
^PW1046
^LL0267
^LS0
^FO448,96^GFA,00768,00768,00012,:Z64:
eJzl0TEOQiEMBuASho69gb2I4V3rDcRg3sHEm3CEjh2M6PMV0Lg4GBc7fUMD/w8AfzBUq7zZpWF8NfgMnxhlmC+Y8SQPT1dfyBzZCU+bZ0oSbF8w6b7Zpxg3u+Jz0GEWc62ZyzDlYWwu93pP7vur2zniIEi/N0cdGdQywIzHnvPAruzMay9G6X1pUXsHSnjWL/7Yz+YGfRNqLw==:7BBD
^PQ1,0,1,Y^XZ
The second line from the button upwards is the problem, I believe. Around there is where, normally, "Text" would be standing, however, now there's just gibberish.
I absolutly need this to be saved correctly, as I later need to access it via python. Please help me by explaining why this happens, and / or how I can fix this.
You need to use a font that is built into the printer. If you set the font to Zebra 0 you get something like:
CT~~CD,~CC^~CT~
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR4,4~SD22^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL1218
^LS0
^FT160,391^A0N,135,134^FH\^FDhello^FS
^PQ1,0,1,Y^XZ

ways to include miscellaneous symbols like Recycle, Rain on the ZPL files for printing labels

I am new to ZPL coding and am not sure how to include miscellaneous symbols like Recycle, Rain on the ZPL files for printing labels.
I tried a bit of coding in UTF-8 encoding by using ^CI28 command and converted the recycle and rain logos to hexadecimal and tried escaping the default underscores using ^FH command but no avail.
^XA
^CI28
^CFT,30,30
^FO50,50^FH^FDTesting^FS
^FO50,100^FH^FD_e2_99_b2^FS
^XZ
In UTF-16, it is printing &72 instead of recycle logo
^XA
^CI29
^CFT,30,30
^FO50,50^FH^FDTesting^FS
^FO50,100^FH^FD_2672^FS
^XZ
Also the results i checked are from simulator available in http://labelary.com/viewer.html. Not sure if there is an issue with my code or simulator in which i am seeing the output.It will be great if any ZPL coding experts can provide some pointers on this regard. Thanks in advance!
Store the images on the printer's memory, and call them up as you need them with the image command.

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

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