1

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.

Solo
  • 57
  • 1
  • 11
  • That is a perfectly normal ZPL, it's just the entire contents of your label is expressed as a static pre-made picture (the `^GFA` command sends a bitmap picture to the printer; the binary content is zipped and base64-encoded, hence the `:Z64:`). This is the kind of ZPL the official driver produces when you print to a Zebra printer from a Windows app "normally". – GSerg Sep 09 '20 at 13:49
  • Obviously, you cannot revert that resulting picture to the original ZPL that was executed to produce it. – GSerg Sep 09 '20 at 13:58
  • @GSerg Does that mean that there is no way for me to get the original text? – Solo Sep 09 '20 at 14:00
  • I don't know what that program does. There is no way to get the original text from this code, but if all you need is to print it without amending parts of it, you can use it as is. And if you do need to amend parts of it when printing, it's always better to just learn ZPL and create the label in it directly. – GSerg Sep 09 '20 at 14:17
  • @GSerg Thats very unfortunate - just learning ZPL is not an option, as the user needs to be able to create these labels comfortably (I myself am not the user). Most of the label is static, but a few lines of text need to be individualized on print. I wanted to do that in python by modfying the zpl code and then sending it to the printer. Do you maybe have an idea for a different way to make this work? – Solo Sep 09 '20 at 14:30
  • Make sure the label only contains the static parts, and then just add the dynamic fields instead of modifying the existing ones. It will print over the static image which is also a proper way of doing it. Then again, how were you going to dynamically insert content into a user-generated label if they could place things all over the place? – GSerg Sep 09 '20 at 14:35
  • @GSerg In my special case, it would have been possible as the user only needs a specific amount of fields with a specific type of content. Even if they rearenge the layout, these fields will always be somewhere. Per default, they'd contain keywords, which my python code looks for and then replaces with the individually generated content. That was the idea, and it worked until ZebraDesigner stopped spitting out readable zpl code. Thanks anyways, but it looks like I need a new way of doing it :) – Solo Sep 09 '20 at 14:48

1 Answers1

2

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
banno
  • 1,529
  • 8
  • 12