Is there a way to mirror text in ZPL? - zpl

I work with labels that have a clear portion and are covered before being affixed to assets. Is it possible to print mirrored text on a Zebra printer mirrored so that we can see the asset number on the back (sticky) side in the clear portion?

You can use the ^FP command to print text reveresed -> ^FPR:
From the ZPL docs (^FP):
^XA
^FO350,50
^FPR,10
^AV
^FDreverse^FS
^XZ
Result:

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

Dotted or dashed lines possible with ZPL II?

I'm working on creating a new ZPL label, and would like to draw a dashed line, but I haven't found any information on how to do that or if it's even possible.
Am I asking too much of ZPL?
You can easily create a dashed pattern with ^GF. It's not the most efficient way in terms of ZPL code size, but it's very easy to amend by hand:
^XA
^FO10,10
^GFA,100,100,50,FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000FFFFFF0000^FS
^IS1.png,N
^XZ
Result:
You should use the zebra zpl designer program , which allows you to create the label like WYSWYG (what you see is what you get or something like that) and then print it to a file, to have a .prn file to you can inspect the code. And then you can use this site: http://labelary.com/viewer.html to prove it.

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

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 to print strike through

Is there a way to use ZPL to print text with a strikethrough (a line through the text)?
I need to be able to print something and indicate that it was there. I have looked through the ZPL programming guide and I have not found any way to alter the font....
An alternative approach would be to draw a line through your text. Here is a sample. You would need to calculate the points of the line based on the coordinates of the text:
^XA
^FT62,93^A0N,42,40^FH\^FDstrikethrough^FS
^FO41,76^GB268,0,5^FS
^PQ1
^XZ
AFAIAA, No.
Could you simply draw a line over the required text? Perhaps you could use or manufacture a downloaded bitmap font which is "struck through?"
OTOH...
To underline - use a monospaced font like AA,AC,AD,AF or AG
Use
^FO350,50^AGR^FDwhatever,milk,butter,salt^FS
^FO340,50^AGR^FD ____ ______^FS
where the underline here is under milk and butter, you can adjust the offset by trimming the FO's X and Y positions by a few dots (10 X here). Naturally, that can be raised for strikethrough, too...

Resources