PrintBase
  • Product
  • Pricing
  • Docs
  • Resources
PrintBase/专题/打印排障

标签条码模糊:用 PDF 还是指令

热敏头适合用 ZPL 或 TSPL 画条码。PDF 条码是图片,被驱动缩放后会扫不上。类型不要标反。调用 POST /v1/print-jobs,API Key 只放在服务端。

面向 热敏标签扫不上的人

其他语言版本: English

说明

PDF 里的条码是像素。驱动一缩放,模块宽度就变了,扫描枪不认。ZPL 的 ^BC、^BQ 或 TSPL 的 BARCODE 是让打印机自己画。打印机由门店电脑上的 Agent 主动连出,不需要公网 IP,也不需要把 9100 端口映射到互联网。

快递公司已经给了标准 100×150 PDF 时,按原尺寸打印,关掉适应页面。不要把 PDF 重画成失真的指令,也不要把 PDF 字节标成 raw。标反会 INVALID_CONTENT。

这是英文条码模糊页的中文版。203 dpi 大约每毫米 8 点。

创建任务使用 POST /v1/print-jobs,请求头 Authorization: Bearer,正文包含 printer_code、content_type(pdf 或 raw)以及 content 或 content_url 二者之一。免费套餐是一台电脑每月 100 个任务。

创建任务使用 POST /v1/print-jobs,请求头 Authorization: Bearer,正文包含 printer_code、content_type(pdf 或 raw)以及 content 或 content_url 二者之一。免费套餐是一台电脑每月 100 个任务。

接入步骤

  1. 01

    看文件头

    %PDF 就用 content_type pdf,并核对页面尺寸。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

  2. 02

    自己生成的条码

    打印机认 ZPL 或 TSPL 时用 raw。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

  3. 03

    关掉驱动缩放

    适应页面是发糊的常见原因。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

  4. 04

    先扫一张样张

    再批量。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

Node.js

// 用指令画条码
const res = await fetch('https://api.printbase.cloud/v1/print-jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': labelId,
  },
  body: JSON.stringify({
    printer_code: Number(process.env.PRINTER_CODE),
    content_type: 'raw',
    content: Buffer.from(zpl,'utf8').toString('base64'),
    copies: 1,
  }),
});
if (!res.ok) throw new Error(`PrintBase ${res.status}: ${await res.text()}`);
const job = await res.json();
// { id: "job_abc", status: "queued" }

这一套的细节

魔法数字

raw 遇到 PDF、PNG、JPEG、ZIP 会 INVALID_CONTENT。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

得力和汉印

系列型号不一定开了 ZPL。没测过就用尺寸正确的 PDF。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

常见问题

所有标签都该用 ZPL 吗?

不。DYMO、兄弟、得力驱动机应使用 PDF。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

接口能把 ZPL 渲染成图片吗?

不能。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

激光上清楚、热敏上糊?(详见本页)

头和缩放不同。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

份数?(详见本页)(详见本页)

先修好一张,再设 copies。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

相关页面

  • 佳博 GP-1324D 远程打印 TSPL 或 ZPL 标签

    GP-1324D 常见指令是 TSPL,部分机器可切到 ZPL。先在厂商工具里确认,再按 raw 发送。调用 POST /v1/print-jobs,API Key 只放在服务端。

  • TSC TTP-244 Pro 远程打印条码标签

    TTP-244 Pro 是 TSC 的 203 dpi 桌面机,指令用 TSPL。SIZE 和 GAP 写在指令里,不是 JSON 字段。调用 POST /v1/print-jobs,API Key 只放在服务端。

免费套餐:一台电脑每月 100 个任务,不需要信用卡。

免费注册查看 API 文档
PrintBase

PrintBase connects your applications to physical printers anywhere - securely, reliably, and in real time.

Product
Receipt PrintingLabel PrintingDashboardDevicesWebhooks
Resources
DocsBlogStatusAPI ReferenceDownloadPrintBase vs PrintNodePrintNode PricingFAQ
Guides
All guidesIntegrationsPrintersCode samplesComparisonsUse casesTroubleshooting
Company
ContactSecurityPrivacy

© 2026 Aveniq Technologies OÜ. All rights reserved. PrintBase is a service of Aveniq Technologies OÜ.

PrivacyTermsRefunds