0

I need to store a couple of labels in ZPL format in a Zebra printer. I'm using Zebra SDK with C#

My code:

foreach (var label in Directory.GetFiles(@"C:\Labels\"))
{
    PrinterUtil.StoreFile(CONNECTION_STRING, label, item.Replace(@"C:\Labels\", "R:"));                                
}

The file uploads, but does not print because at the first line the printer add an extra ^XA or in some cases ÿþ^XA. The original file already starts with ^XA. So I have to remove the line that the printers adds to been able to print the label.

Is there some configuration code I'm missing? Any ideas?

Jdh.Dev
  • 1
  • 1
  • What does the documentation on `PrinterUtil.StoreFile` say? The `ÿþ` is the [UTF-16 BOM](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-16). – GSerg Feb 20 '22 at 11:02
  • The docs say nothings. The URL is https://techdocs.zebra.com/link-os/2-14/pc_net/content/html/d79c6636-32e0-64db-6300-04c8f5894f0c.htm – Jdh.Dev Feb 20 '22 at 11:50
  • I would then [decompile](https://stackoverflow.com/a/7664693/11683) and see what it does. – GSerg Feb 20 '22 at 16:44

1 Answers1

0

^XA denotes the start of label and ^XZ denotes the end of label. If you are trying to print multiple labels together, then ZPL file would comprise multiple ^XA...^XZ blocks. You can use http://labelary.com/viewer.html to preview your labels.