0

I downloaded ZebraDesigner 3 to create a custom label with a text field where I wrote "Hello World".

Then I wanted to get its source code by "print to file", but when I open it with any editor I can't find what I wrote previously (Hello World).

What I wanted to do is creating a label with some text fields that are variable because they will get values from my C# application.

This is what I get from .prn file (file created by printing to file function)

^XA
^MMT
^PW639
^LL0320
^LS0
^FO192,128^GFA,01792,01792,00028,:Z64:
eJzt0jFOAzEQBdCxXLjzXsBarjEFYq/kdBRRAhfIebYcxAE4ArMXQKZzgdaMhygOiSKElAKkHRe70iu88/8CLPMfhuUARnmLJhmSJ4L/laFJ9uGS2fHqFuzo4NQ6wtgRBBccbMwLul2zIWEckpopj69489ZsmzFus5otTzMO895K4XyLMa/By7jnKeH9phkHjBy+DCbG2B9sIo8r7tU6eCdM/eE+NfJqHlaE3HaYyqwmnxKuZgQ/mkQ9nhmD7lDtdAdmr7tXk92p7S62z8xmkyUzwvXdUdYfmrX8SkmyppZ17ShrR9WkI/rWUcfabTXpllq3yyzzV+cTr8C3dA==:ED50
^PQ1,0,1,Y^XZ

How can I change those text field from C#?

Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
Alessio Raddi
  • 540
  • 1
  • 6
  • 20
  • 1
    You may be better off looking up the ZPL documentation. From the looks of your sample, it may be printing as a graphic. From the old ZPL documentation I found: "The ^GF (Graphic Field) command allows you to download graphic field data directly into the bitmap. This command follows the conventions for any other field meaning a field orientation is included with this command. The graphic field data can be placed at any location within the bitmap space." – Wiz Dec 09 '19 at 14:49
  • That is most certainly a ZIP-compressed picture of the label. This is what the driver produces - you can't blame it, it would be pretty hard to convert random document from a random Windows application to a meaningful series of fields with data. If you want those, you need to create the label template yourself from scratch in ZPL and not rely on Windows printing. – GSerg Dec 09 '19 at 15:25
  • @GSerg fair enough! Thank you for the help though, at least now I'll focus on creating it myself. – Alessio Raddi Dec 09 '19 at 15:36
  • What printer driver are you using? Have you tried ``Generic / Text only`` driver? – Delphi Coder Dec 10 '19 at 06:07
  • @DelphiCoder, I installed my printer's drivers which are GC420t (EPL) and ZPL one – Alessio Raddi Dec 10 '19 at 10:09
  • Which font did you choose or was chosen by default? Have you tried a native printer font, e.g. ``TRIUMVIRATE COND.``? – Delphi Coder Dec 10 '19 at 10:29
  • @DelphiCoder Yes I chose "Zebra1" – Alessio Raddi Dec 10 '19 at 10:36
  • Are there any options for the text field, like to print it as text or as graphic? Have you tried other (native) fonts? – Delphi Coder Dec 10 '19 at 10:40
  • @DelphiCoder Unfortunately there aren't any other options – Alessio Raddi Dec 10 '19 at 10:58
  • Does this answer your question? [Missing fields in ZPL code after EXPORT from ZebraDesigner](https://stackoverflow.com/questions/71509641/missing-fields-in-zpl-code-after-export-from-zebradesigner) – GSerg Mar 22 '22 at 12:27

2 Answers2

3

The "Print to file" feature sends the label image to the Zebra driver, which converts it to a picture, encodes and ZIP-compresses it, and produces a ZPL file where the only payload is that single picture (and several supplementary commands to set label dimensions and print quantity). You can't blame the driver, it would be pretty hard to convert random document from a random Windows application to a meaningful series of fields with data.

The payload command in your file is

^GFA,01792,01792,00028,:Z64:
eJzt0jFOAzEQBdCxXLjzXsBarjEFYq/kdBRRAhfIebYcxAE4ArMXQKZzgdaMhygOiSKElAKkHRe70iu88/8CLPMfhuUARnmLJhmSJ4L/laFJ9uGS2fHqFuzo4NQ6wtgRBBccbMwLul2zIWEckpopj69489ZsmzFus5otTzMO895K4XyLMa/By7jnKeH9phkHjBy+DCbG2B9sIo8r7tU6eCdM/eE+NfJqHlaE3HaYyqwmnxKuZgQ/mkQ9nhmD7lDtdAdmr7tXk92p7S62z8xmkyUzwvXdUdYfmrX8SkmyppZ17ShrR9WkI/rWUcfabTXpllq3yyzzV+cTr8C3dA==:ED50

, which unzips to

enter image description here

There is not much to edit there.

In order to manually achieve the same, you would write:

^XA
^MUm
^FO10,10^A0,10^FDHello World^FS
^MUd
^XZ
GSerg
  • 76,472
  • 17
  • 159
  • 346
  • Yes, I know there isn't much to edit in that label, but it was just an example because I have a "more complex" label, where I have some text field as Fixed Data, and others should be variable (assigning the value from C# app). Is there any way to unzip the image to obtain ZPL code? – Alessio Raddi Dec 10 '19 at 10:14
  • @AlessioRaddi The ZPL code, no. The image contains the final rendered bitmap. – GSerg Dec 10 '19 at 10:19
  • Sorry for being so stubborn, but there is no way to get ZPL code unzipped from "Print to File", right? – Alessio Raddi Dec 10 '19 at 10:28
  • 1
    @AlessioRaddi The result you got from "print to file" **is** ZPL. Only the text "Hello World" was converted to bitmap instead of a ZPL text command, whyever – Delphi Coder Dec 10 '19 at 10:39
0

First of all when you crete the label file layout and you introduce the text you will need to use only Zebra printer fonts. At the font style tab you select "Show printer fonts only". With this option all text will remain text and will not be converted to graphic image.

Second part is the driver you use. You need to use ZPL printer driver and not EPL. You export by selecting print to file or you create a fake port what you direct to a txt file. The print to file option will create PRN file but content is 100% ZPL.

I did this several times and it is working. I created a lot of labels with complex layouts and variables and never had any issue exporting them.

William Baker Morrison
  • 1,642
  • 4
  • 21
  • 33
Robert
  • 1