0
votes

I'm trying to print a Code 128 (Subset A?) barcode to a Zebra label printer. It looks to be printing, and can be scanned by ZXing barcode scanner on my phone, but when using a barcode scanner, it won't read.

Generating the same barcode using MPDF (type="C128A"), generates a barcode with different bars that the barcode scanner we're using does read.

Here's my ZPL: (ZPL Output)

^XA

^BY4,2,164^FT70,330^BCN,,Y,N,Y,N
^FD>9171716171724161925^FS

^XZ 

And the equivalent barcode tag used in mPDF: (mPDF Output)

<barcode code="110118039" type="C128A" size="1.5"/>

Any ideas what I'm doing differently between the two would be greatly appreciated.

2

2 Answers

0
votes

Looks like the issue was scanner configuration at the user end. Despite the differences in bars, both of the above are actually reading correctly.

0
votes

I noticed a few problems

  1. You have a ">" in your ZPL within the FD field.
  2. The data you have encoded is not the exact number you are trying to get a barcode for. I wonder how you got what you got, and how it's generating the desired number.
  3. I see you are using the UCC Check Digit = Y parameter. Default is N. You probably don't need this parameter.

Proper ZPL:

^XA
^FO100,100^BY3
^BCN,100,Y,N,N
^FD110118039^FS
^XZ