Tools/Printer languages/CPCL Validator

CPCL Validator

Check CPCL code before sending it to a printer: unknown commands, missing fields, a missing session header, fonts outside the table and barcode types outside the MVP are reported with line numbers.

Coverage: 6 commands supported, 5 partially supported, 7 recognized as printer-behaviour (not drawn). The preview renders at 203 dpi and is an interpretation of the Zebra CPCL programming guide — it has not been verified against a physical printer.

Paste your code

Paste code or load the sample — the result appears below, with the line and severity of each finding.

Result

LineSeverityMessage

Render your code: CPCL viewer

How to validate CPCL code

  1. Paste the CPCL job and press Render — findings are listed with line numbers.
  2. Errors (unknown command, missing fields) mean the line will not print what you expect.
  3. Warnings (missing session header, font outside the table, barcode type outside the MVP) mean the preview substitutes or skips something.
  4. Info entries mark printer-behaviour commands (CONTRAST, SPEED, SETMAG) that do not affect the image.

When this is the right tool

Run it before sending CPCL to mobile printers in the field, after hand-editing a job, or when a receipt prints blank or truncated. It checks against the same command registry the viewer renders from — what the validator accepts, the viewer can draw.

Frequently asked questions

  • Does a clean result guarantee a correct label? — No: it means the MVP checks passed. Data-level mistakes are yours to verify — the barcode verifier can read back a printed label.
  • Why is a valid CPCL command reported as unknown? — The validator's registry equals the preview's coverage; commands outside the MVP are honestly reported instead of silently accepted.
  • Why does a missing ! line only warn? — The preview can still draw with defaults, but on a real printer the header is what sets label height and copies — fix it before printing.

Save your labels to your account and print them with DirectPrint — free account. Create free account

Do the same job from code

Same engine, same result: REST API, command line, or an AI assistant over MCP. Anonymous calls work; an API key raises the quota.

RESTcurl -X POST "https://api.labelixa.com/v1/cpcl/diagnostics" --data-binary @label.cpcl
MCPclaude mcp add --transport http labelixa https://api.labelixa.com/mcp # cpcl_validate

API reference · MCP setup · Thermal label API: ZPL, EPL, TSPL, CPCL

Run this check on every pull request with the GitHub Action