ZPL 指令速查表

快速搜尋常用 Zebra ZPL 指令、範例與標籤列印說明,涵蓋版面、文字、條碼、圖形與設備設定。

ZPLZebra標籤工作流
^XA

开始标签格式

^XA

每个标签格式都应由 ^XA 开始、^XZ 结束。

^XZ

结束标签格式

^XZ

缺少 ^XZ 是打印任务失败的常见原因。

^PW

打印宽度

^PW812

Width in dots = physical width in mm × actual dpmm.

Changing print width does not scale existing fields.

^LL

标签长度

^LL1218

Label length in dots = physical height in mm × actual dpmm.

A larger ^LL does not move or stretch content; choose matching preview dimensions.

^FO

字段原点

^FO50,80

x,y in dots; the field starts at this origin.

Coordinates are not millimeters. Global offsets and rotation can change placement.

^FT

字段排版位置

^FT50,120

x,y in dots; text uses the typesetting baseline.

Using the same y as ^FO does not give the same text position.

^A

字体选择

^A0N,40,40

选择字体、旋转方向、高度和宽度。

^FD

字段数据

^FDHello^FS

字段中的文本或编码数据。

^FS

字段分隔符

^FS

结束一个字段。缺少分隔符会造成难以排查的输出。

^GB

图形框

^GB400,2,2^FS

绘制线条、方框和分隔线。

^BY

条码默认值

^BY3,2,120

设置条码模块宽度、比例和高度默认值。

^BC

Code 128 条码

^BCN,120,Y,N,N

orientation,height,human-readable,above,check-digit,mode. Example: ^BCN,100,Y,N,N.

Use ^BY for module width, preserve quiet zones, and verify decoded data with a scanner.

^BQN

二维码

^BQN,2,6^FDQA,https://example.com^FS

N orientation, model 2, magnification in dots. ^FDLA,data selects error correction L and automatic input.

Missing the data prefix can change interpretation. Leave a quiet zone of four modules and test the output.

^BX

DataMatrix

^BXN,5,200

orientation,module size,ECC quality,columns,rows,format,escape. Example: ^BXN,5,200,0,0,1,~.

Module size is in dots, not bar height. ECC 200 uses a numeric quality value. GS1 requires FNC1, not a literal GS character at the start.

^CI28

UTF-8 编码

^CI28

Select UTF-8 before the text fields; save the source as UTF-8.

The printer font must contain the requested glyphs. Encoding alone does not install fonts.

^LH

标签原点

^LH0,0

偏移整个标签坐标系统。

~SD

打印浓度

~SD15

打印机设置。请在真实耗材上谨慎测试。

^PR

打印速度

^PR4

打印速度会影响条码质量。

如何使用這個工具

先使用範例資料

透過預設值了解工具預期的 ZPL 結構和輸出形態。

依印表機調整

上線前檢查標籤尺寸、DPI、條碼資料和印表機相關設定。

預覽或複製結果

當工具生成 ZPL 時,建議繼續用主 ZPL 預覽器做最終視覺檢查。

常見問題

不能。它用於在實機驗證前提前發現明顯的版面和資料問題。
請把它們當作起點。生產前仍要核對印表機型號、DPI、耗材和業務資料。
部分列印語言並不是一一對應。清楚的遷移映射比假裝每個 ZPL 指令都能完美轉成 EPL 或 CPCL 更可靠。
ZPL 指令速查表