Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

QR code missing characters after printing with Zebra S4M

I am programming a Zebra S4M template:

^FX[Fonts]^FS
^FX[Graphics]^FS
^FX[Format]^FS

CT~~CD,~CC^~CT~

^XA
^DFR:QR.ZPL^FS
~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR3,3^MD10^LRN^CI0
^MMT
^PW980
^LL0461
^LS0
^FT137,424^BQN,2,7
^FN24^FDQR_CUST_CODE^FS
^XZ

The line in question is ^FN24^FDQR_CUST_CODE^FS, where the variable is supplied in a .xml file

<?xml version="1.0" standalone="no"?>
<!DOCTYPE labels SYSTEM "label.dtd">
<labels _FORMAT="R:QR.ZPL" _QUANTITY="1" _PRINTERNAME="Printer 1" _JOBNAME="LBL101">
    <label>
        <variable name="QR_CUST_CODE">11112345678</variable>
    </label>
</labels>

The resulting code only contains values 12345678, so I am missing first 3x1. Any suggestions? Tried to add QA to the FD but it does not work.

question from:https://stackoverflow.com/questions/65903068/qr-code-missing-characters-after-printing-with-zebra-s4m

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When creating a QR Code in ZPL, the ^FD command has additional arguments that must be set before the data is added.

Change your last line as show here:

From:

^FN24^FDQR_CUST_CODE^FS

To:

^FN24^FDMM,NQR_CUST_CODE^FS

Below is example from the BQ Command guide that should help you further.

enter image description here

https://support.zebra.com/cpws/docs/zpl/BQ_Command.pdf


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...