简体   繁体   中英

Why is this ZPL code printing text in middle of label for Zebra printer (and sometimes then prints extra blank label)?

Problem

I have a Zebra ZD500R printer. I have a label that is 1.0” x 1.75”. I have a simple winform C# and .NET application that prints ZPL code to a label. The undesired result is shown below. Clearly the printed label is not matching my Zebra Label design:

Problem Label 在此处输入图片说明

Label Design 在此处输入图片说明

Zebra Printer Settings for label design

在此处输入图片说明

The ZPL code was generated by printing the zebra designer label to a file.

Code

The following is the ZPL code that is sent directly to the printer for printing.

string ZPLString =
                "^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR4,4~SD10^JUS^LRN^CI0^XZ" +
                "^XA" +
                "^MMT" +
                "^PW229" +
                "^LL0339" +
                "^LS0" +
                "^FT210,284^A0I,42,40^FH\\^FDSample^FS" +
                "^FT208,216^A0I,42,40^FH\\^FD94551337^FS" +
                "^PQ1,0,1,Y"+
                "^XZ";

Attempts

I have done the following trying to solve this problem:

  • RTFM by Zebra
  • Sample Code (only hello world with no settings on printer)
  • I tried portrait and all other settings for the ZPL code and only got a variant of the problem as shown above.

I eventually want to encode an RFID label, but they are expensive. I don't want to test until I am sure I got the label printing part working correctly. Any advice, tips, or comments would be deeply appreciated.

It's been a while since I had to work with a Zebra Printer and I don't have one to test, but for what i recall I see things in the ZPLstring that are just not necessary.

Also I used the designer very little, just to check how something are done, then use the manual to see which commands are the important ones, to my taste it generates lots of commands that are not useful and that can be set phisically in the printer.

Have you tried using only one label format, just one ^XA an the beginning and a ^XZ at the end?

or have you tried sending just the most basic necessary code to the printer? Something like start label, origin position, text, end label

Hope something helps or gives you more ideas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM