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

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.

Related

Vietnamese text printing on ZPL printer using Zpl commands

I am trying to print Vietnamese text on my Zebra label using Zpl coding.
But i am getting issues in vietnamese characters. For example, i am trying to print a label with text "Nhập khẩu" but it is giving me the output "Nh p kh u", thus missing the Vietnamese fonts.
I have tried using Andale and Swiss font and also declaring the ^CI28 tag for printing various characters in utf-8 encoding.
If anyone else has any other inputs, please let me know.. thanks in advance..
EDIT:
This is the code i am using..
^XA^CWZ,E:TT0003M_.TTF^FS^XZ
^XA
^CF01,20,15
^CI28
^FO20,20^FDNhập khẩu - LOẠI:For Fujifilm^FS
^XZ
Have you tried google's Noto fonts?
https://fonts.google.com/specimen/Noto+Sans
I have used them to render Vietnamese. If that doesn't work, post the sample ZPL you have tried and we can work through it.
Here is some example ZPL. This assumes the Noto Sans font is saved to the printer as E:NOTOSANS.TTF:
^XA^CI28
^A#N,32,32,E:NOTOSANS.TTF
^FO50,50
^FDNhập khẩu^FS
^XZ

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

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 fieldblock ^FB for unicode fonts

I am using ZQ520, its already supports Unicode and I am loading the font as follows:
^XA ^CWZ,E:TT0003M_.FNT^FS^XZ
I can use the font to print Arabic as follows:
^FO100,50^CI28^AZN,0,25^FD ARABIC TEXT HERE ^FS
It works fine but when I use ^FB with ^FO, the Arabic letters get messed up and gets separated (In Arabic, they are connected), here an example:
^FO100,50^FB200,,,R,^CI28^AZN,0,25^FD ARABIC TEXT HERE^FS
so it seems that ^FB does not support the Unicode font. on page 187 of the manual its mention this
The ^FB command does not support complex text. For complex text
support, use ^TB.
And 179
The Field Block (^FB) command cannot support the large TrueType fonts.
Is there a way around this? Because Arabic is right to left, so I am trying to make the text right aligned and multi-line as some strings are long.
I managed to print out word wrapping Arabic text using ^TB using the following code. It may be useful to adapt for your own purposes.
^XA^LRN^CI28^CWZ,E:TT0003M_.FNT^FS
^FO600,10,2
^AZN,50,40
^TBN,600,100
^FH
^FD
arabic text here
^FS
^PQ1
^XZ
Useful links:
TB command (some extra info compared to below link): https://support.zebra.com/cpws/docs/zpl/TB_Command.pdf
Please note that it states the ^TB command must be issued after any ^Ax (font selection) command
ZPL Manual: https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf

Printing Images with ZPL code

I'm using ZDesigner to create my label and generate the zpl code. My label have several text boxes, a barcode, and a logo image.
I used the generated code on this webpage -> http://labelary.com/viewer.html, and the output was fine.
When I send the same zpl code to the printer (GC420D, installed as generic/text only) the logo image it's not printed.
ZDesigner uses the command ^GFA to send the image to the printer, I tried with diferent extensions (.pgn, .jpg and .bmp) and the results is always the same, no logo.
Any ideas why?
generated code:
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD15^JUS^LRN^CI0^XZ
^XA
^MMT
^PW570
^LL0320
^LS0
^FO220,170^GFA,8000,0800,00020,:Z64:
eJztkjFugzAUhp+dICrUAUsQ1ogJsVXNASzV6dTBSH7KmiN4SMWKsvcOiAlxigw9QIdwnxooGFVl6FCpQ/7Blu3P7/2/ZYCb/pvIm2T37y9XLpk/bRbdUEEMiQUfpe88w+b4MLtcjMOd3XMA1oILIcnfmabnpvSg9GhTTHvuKtcbcty4OZ9z9cCV1h+RKiA8AGI5j5ZJSguT1nKuy/VuxXdAjjOuSJKOo7ZviBcZkEtA2svUNo2rnvOsv/BwQH1yQUczf55XlB2XThxRao9KOiCVM3LUcLRKht5jCpZH4auOiNaufZfaBKnTc5l4Iyfwim2LLX5ga9vWXnNOq6ZMm7FtdthFeZY/nXSkYVlrMRRV49oeUTrjmE/QjAy/MvjwswRBRGkL9jiNId7205De2JNhliECw6Hg9DTfxZX5eYYRBjbXhHU3Ouxdku5vMiY7h8gJLtlb9/mEMrn3xqjo2m5n5zTezuIxE4JlRnKhHHA7CaOlFHMRxpbc3XTTr/QJea9YBw==:F9E4^FS
^FT128,67^A0I,12,14^FH\^FDData de Emiss\C6o^FS
^FT128,129^A0I,12,16^FH\^FD#DOCUMENT#^FS
^FT76,103^A0I,12,16^FH\^FD#VAL#^FS
^FT100,49^A0I,12,16^FH\^FD#DE#^FS
^FT255,50^A0I,12,16^FH\^FD#CE#^FS
^FT408,46^A0I,12,16^FH\^FD#CC#^FS
^FT110,209^A0I,12,16^FH\^FD#Eur#^FS
^FT134,227^A0I,12,16^FH\^FDRecibo n\A7^FS
^FT124,101^A0I,12,16^FH\^FDEur^FS
^FT300,67^A0I,12,19^FH\^FDC\A2digo Entidade^FS
^FT434,67^A0I,14,16^FH\^FDC\A2digo Cliente^FS
^BY2,3,20^FT441,119^BCI,40,Y,N
^FD>;12345678>69^FS
^PQ1,0,1,Y^XZ
here is my answer a little late but it may be useful for someone. I had a problem when performing a print service for an android application, when pasting the zpl code into the text editor I was not noticing that for some reason some blank spaces were being added, I realized until I copied the code and I viewed it here http://labelary.com/viewer.html
after that I remove the blank spaces and the image could be displayed
zpl code with blank spaces

Resources