Skip to content

PRD — Label Studio (zpl-viewer)

Product requirements for Label Studio: problem, users, goals, scope and proposed success metrics, derived from this repo's README, agent docs, config and code, with anything they do not state marked TBD.

1. Overview / problem

Label Studio is an offline VS Code extension to read, preview, create, modify, analyze, import, merge and deploy ZPL II and EPL2 thermal labels. Everything except deployment runs locally — no HTTP calls, external services, Docker or binaries.

1.1 Missions

Label Studio's direction is to become the ultimate open home for all things thermal labels — data, tools, resources and transparency, gathered in one place that anyone can inspect and reuse.

  1. Provide data, tools, resources and transparency for all stakeholders, label practitioners and the general public. Developers and integrators, warehouse and IT staff, and the general public are first-class audiences. The aim is a shared, open commons: the same sources, the same tools, and the same trail of evidence for everyone.
  2. Make every ZPL II and EPL2 label readable, previewable, authorable, analyzable and mergeable entirely offline. Everything except explicit deployment runs locally — no HTTP calls, external services, Docker or binaries required to edit. A shared intermediate representation is the path to conversion between dialects; every preview and analysis stays inspectable.
  3. Put that studio in every operator's hands, and make deploying a label to a printer effortless and auditable. Serve it as a VS Code extension that can merge data and deploy over raw TCP, a device path or a spool directory — an open toolkit for working with all things thermal labels.

These missions set the course; they do not claim the work is finished. They serve the PRD goals in §3: accurate preview and export, barcode validation, dialect conversion, and a fully offline editor except explicit deploy. The earlier mission paragraph is absorbed into these three. Every feature must trace to them.

2. Target users

  • Developers and integrators writing ZPL/EPL labels (shipping, product, asset tags)
  • Warehouse/IT staff troubleshooting printer captures

3. Goals and non-goals

Goals

  • Accurate live preview and export (PNG/PDF/SVG)
  • Validate barcodes before printing
  • Convert between ZPL II and EPL2 via one shared IR
  • Fully offline except explicit deploy

Non-goals

  • Cloud rendering services
  • Telemetry or network calls during editing

4. Core features (current)

  • Syntax highlighting, hover docs, IntelliSense, outline/folding
  • Live canvas preview with zoom and paging
  • Templates, snippets and Barcode Studio (24 symbologies via bwip-js)
  • Formatters, image import, format conversion; all ZPL graphic encodings
  • Analysis: metrics, ink coverage, lint rules
  • Data merge of {{placeholder}} templates from CSV/TSV/JSON/JSONL
  • Deploy via raw TCP 9100, device path or spool directory

Feature catalog

Every user-facing capability has a stable id in the feature catalog features/features.yml. Each entry names the PRD requirements it serves (prd:); the trace below is the reverse view.

ID Feature Status Where Requirements
ZPL-001 Syntax highlighting shipped src/providers · README.md FR3
ZPL-002 Live canvas preview with zoom and paging shipped src/previewPanel.ts · README.md FR4
ZPL-003 Templates, snippets and Barcode Studio shipped src/barcode · README.md FR2
ZPL-004 Formatters, image import, format conversion shipped src/formatting.ts · README.md FR5
ZPL-005 Analysis: metrics, ink coverage, lint rules shipped src/analysis · README.md FR2
ZPL-006 Data merge of {{placeholder}} templates from CSV/TSV/JSON/JSONL shipped src/data · README.md FR6
ZPL-007 Deploy via raw TCP 9100 shipped src/deploy · README.md FR7, NFR3
ZPL-008 Preview ↔ source navigation planned src/previewPanel.ts · PRD.md FR8
ZPL-009 Restricted Mode support planned package.json · PRD.md FR9
ZPL-010 Density and orientation transforms planned src/core/pipeline.ts · PRD.md FR10
ZPL-011 Diagnostic quick fixes and rule explanations planned src/diagnostics.ts · PRD.md FR11
ZPL-012 PDF sheet layout planned src/webview/main.ts · PRD.md FR12
ZPL-013 Missions in constitution §1 planned docs/constitution.md §1.1

Requirement → feature trace

Requirement Features
FR3 ZPL-001
FR4 ZPL-002
FR2 ZPL-003, ZPL-005
FR5 ZPL-004
FR6 ZPL-006
FR7 ZPL-007
NFR3 ZPL-007
FR8 ZPL-008
FR9 ZPL-009
FR10 ZPL-010
FR11 ZPL-011
FR12 ZPL-012
§1.1 ZPL-013

5. Requirements

Functional

  • FR1: .prn/.lbl files sniffed to detect language
  • FR2: Barcode payloads validated for charset, length, check digits, GS1 AI syntax and capacity
  • FR3: Editor language support for ZPL II and EPL2: syntax highlighting, hover docs, completion, outline and folding
  • FR4: Live canvas preview with zoom and paging, and export to PNG, PDF and SVG
  • FR5: Labels converted between ZPL II and EPL2 through the one shared drawing-op IR
  • FR6: {{placeholder}} templates merged with CSV/TSV/JSON/JSONL data
  • FR7: Deploy to a printer by raw TCP 9100, a device path or a spool directory, only on an explicit user action

Functional — planned (deep dive 2026-11-11, not built)

  • FR8: Preview ↔ source navigation: clicking a drawn element in the preview selects the source range that produced it, and moving the editor cursor into a ^XA … ^XZ (or EPL) format shows that label in the preview and outlines the ops under the cursor
  • FR9: Restricted Mode support: declare limited Workspace Trust support so the offline features (language support, preview, export, validation, analysis) work in untrusted workspaces, while deploy and printer profiles from workspace settings are available only in trusted workspaces
  • FR10: Density and orientation transforms: rewrite a label's source for another print density (6/8/12/24 dpmm) or rotate it 90/180/270 degrees, scaling field positions, sizes and graphics and reporting every approximation, for both ZPL II and EPL2
  • FR11: Diagnostic quick fixes and rule explanations: each lint rule id links to an explanation (what, why, a fixed example), and rules with a deterministic fix offer it as a VS Code quick fix
  • FR12: PDF sheet layout: export labels onto Letter, Legal, A4, A5 or A6 pages as an N×M grid with alignment and an optional cut border, alongside the current one-label-per-page PDF

Non-functional

  • NFR1: VS Code ^1.85
  • NFR2: Unit, integration and e2e test suites
  • NFR3: No network access except deploy

6. Success metrics (proposed — not defined in sources)

  • Rendering fidelity vs. printed output: TBD
  • Marketplace installs/ratings: TBD

7. Roadmap / open questions

  • Marketplace publishing plan (release flow: AGENTS.md § Conventions): TBD; releases attach a .vsix to the GitHub Release until the owner registers a publisher and adds VSCE_PAT / OVSX_PAT