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 命令速查表