接口导航
ZPL Conversion API
使用我们简单的 REST API 从 ZPL 代码生成标签预览图片。完全兼容 labelary.com 的接口,只需将域名改为 api.leepow.com 即可。
接口兼容性
本接口完全兼容 labelary.com 服务。您可以继续使用现有代码,只需将域名从 api.labelary.com 改为 api.leepow.com 即可。
接口地址
POST https://api.leepow.com/printers请求体
{
"ZPL": "string (required)",
"OutputFormat": "string (JPG, PNG, PDF, PCL, EPL, PCX, GRF, FP, NV)",
"dpi": "number (152, 203, 300, 600)",
"width": "number (label width in inches)",
"height": "number (label height in inches)"
}ZPL: api.requestBody.ZPL
OutputFormat: api.requestBody.OutputFormat
dpi: 打印密度(每英寸点数)。支持的值:152、203、300、600
width: 标签宽度(英寸)
height: 标签高度(英寸)
代码示例
curl --location 'https://api.leepow.com/printers' \
--header 'Content-Type: application/json' \
--data '{
"ZPL": "^XA^FO50,50^ADN,36,20^FDHello World^FS^XZ",
"OutputFormat": "JPG",
"dpi": 203,
"width": 4,
"height": 6
}'响应
返回请求格式的二进制图片文件(JPG、PNG 或 PDF)。