PrintBase
  • Product
  • Pricing
  • Docs
  • Resources
PrintBase/Guides/Printing troubleshooting

Send raw ZPL or PDF?

Use ZPL or TSPL when the printer speaks it and you draw the label. Use PDF when you already have a document or the printer is a driver device.

For Developers choosing content_type

Overview

content_type has two values: pdf and raw. Raw is for printer languages such as ZPL, EPL, ESC/POS, and TSPL. PDF is for documents and for printers that only work through a driver, including many Rollo, DYMO, and Brother models.

The agent rejects PDF, PNG, JPEG, and ZIP payloads marked as raw. On Linux, raw is sent with lp -o raw. On Windows, raw is spooled from memory. PDF on Windows needs a PDF application that can print to a named queue.

A single simple ZPL label can have copies folded into ^PQ. PDF copies are the copies field and the driver. Do not convert between the two unless you have a reason.

Integration steps

  1. 01

    If the file starts with %PDF

    Send content_type pdf. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.

  2. 02

    If the file starts with ^XA or a TSPL SIZE command

    Send raw. Use POST /v1/print-jobs with Authorization: Bearer and the printer_code from GET /v1/printers.

  3. 03

    If you are unsure the printer speaks that language

    Print one raw test locally before you automate it. Otherwise use PDF.

  4. 04

    Match size

    Dots for commands, page size for PDF. The API does not convert units.

Node.js

// Raw ZPL when you draw the label
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" }

Details for this setup

^PQ folding

One ^XA and one ^XZ, copies greater than 1, and no existing ^PQ, ^SN, or ^SF: the agent inserts ^PQ and prints the data once.

Driver scaling

PDF barcodes fail when the driver scales the page. Commands avoid that. The agent prints only what you send; it does not fetch the document from the platform for you.

Questions

Can I send HTML?

No. pdf or raw only. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.

Can I send a PNG?

Not as a content type. Put the image inside a PDF or a printer language.

EPL? in this setup

Raw, if the printer is in EPL mode. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.

Which one scans better?

Commands, when the printer supports them. A correctly sized PDF is the right choice on a driver-only printer.

Related guides

  • Why a PDF barcode will not scan on a thermal printer

    Thermal heads print crisp barcodes from ZPL or TSPL. A PDF barcode is a picture the driver scales. Send raw commands when the printer speaks them.

  • Print ZPL shipping labels to a Zebra ZD420

    Send ZPL to a Zebra ZD420 from your app. The agent writes raw bytes to the OS queue. No Browser Print port and no public IP.

  • Print 4x6 shipping labels to a Rollo

    Send a 4 by 6 PDF to a Rollo through the OS driver. Do not assume the Rollo speaks ZPL. No PrintBase driver is required beyond what the OS uses.

  • Receipt printer prints garbage characters

    ESC/POS garbage is almost always the code page. The agent does not transcode raw bytes. Encode for the printer before base64.

Free plan: 100 jobs a month on one computer, no card.

Create a free accountRead the API docs
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