ZPL programming on Linux - Why are labels blank?

236 views Asked by At

I'm trying to print my first ZPL label using Linux. The label feeds, but is empty.

My labels are 1 inch wide x 3 inches long, and my printer centralises the roll of labels, so they only occupy the middle portion of the print head.

However, nothing prints, but the printer feeds the label.

I'm trying to print the following file (test.zpl), using very large font (25mm tall) to find my labels:

^XA
^LH0,0
^FX CF command parameters:
^FX - font name / orientation
^FX - font height
^FX - font width
^CFA,200
^FS
^FO0,0^FDzero^FS
^FO100,100^FDone^FS
^FO200,200^FDtwo^FS
^FO300,300^FDthree^FS
^FO400,400^FDfour^FS
^FO500,500^FDfive^FS
^FO600,600^FDsix^FS
^FO700,700^FDseven^FS
^FO800,800^FDeight^FS
^FO900,900^FDnine^FS
^XZ

I've tried to set Label Home to 0,0, so that I can print over the whole print area, to find out what's happening, but no luck.

I have a default print queue let up, and I'm printing with:

lp -o raw test.zpl

The printer simply feeds exactly one label, with nothing printed on it.

2

There are 2 answers

2
ZRep On

Might have nothing to do with the code: are you maybe using thermal transfer paper without a ribbon? If you scratch the paper with your nails, do you see a black line or nothing?

Eventually you can print a configuration label using a combinations of keys and check if it prints something. Have a look here for some info and if you let me know what's the printer model, I can tell you how to print a config label.

0
StuartG On

Figured it out in the end, with lots of trial and error.

The 'normal' shipping label is 4inch x 6inch. My labels are 1inch x 3inch, so there is a great deal of room to miss the target when positioning text on the label.

I had a total lack of familiarity with ZPL, so I also had some errors in that.

In the end, I figured that printing very long 1D barcodes at various positions on the label (or viewport) gave me a better chance of hitting the target, then I could mess with the Field Origin and Label Home settings to get things working.

Anyway, it now works.

Thanks to everybody for your help.

:-)