我有一个关于使用ZPL打印EAN条形码的问题。 为什么条形码和我给出的EAN不匹配?
我有以下ZPL代码来生成条形码。
^XA^PQ1,0,0,N^FO50,20^BY^BEN,140,Y,N^FD4250164837159^FS^XZ
结果如下:
请有人帮我解决这个问题。我已经接近放弃了。
谢谢!
Faby
答案 0 :(得分:2)
I'm not sure calling '^BY' with no values is doing any good, and '^PQ' is set to the default values making it redundant. But regardless, you're passing too many digits in '^FD'. Zebra wants to add it's own checksum:
Field data ( ^FD ) is limited to exactly 12 characters. ZPL II
automatically truncates or pads on the left with zeros to achieve the
required number of characters
See p101 of the Zebra Programming Guide for details. If you need to encode the 9 (which is not the correct checksum) then you should look at EAN14(or GTIN14).