Feature: Printing #594
ChrisEdgington
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Integrating a Full Print System into Carbon
The Problem
Carbon has label generation (
file+/routes that produce ZPL and PDF files) and a standalone print bridge (crbnos/zpl-print— a local server that forwards ZPL to Zebra printers via ngrok). But there's no integrated print system:zpl-printis external — separate repo, manual ngrok setup, ZPL only (no PDF)zpl-printmaps work centers to printers in a config file, but Carbon itself has no awareness of thisThis proposal brings print management into Carbon itself, building on the pattern
zpl-printestablished.The Proposal
A Print Manager — a first-class module in both ERP and MES — that handles all printing through a centralized job queue, inspired by how IFS and SAP handle print output management.
How It Works
Key Design Decisions
Two separate Trigger.dev tasks — generation and delivery are decoupled
print-job-generate: fetches data, generates label content, stores it on the job recordprint-job-deliver: reads stored content, sends to printerPrint Manager as a top-level module — not buried in Settings
Auto-print driven by settings — configurable per business event
Work center → printer routing — operators at different work centers get labels on their nearest printer, not a default printer. Routes are stored in a
printerRoutetable linked to work centers. Printer types correspond tolabelSizesIDs (e.g.,zebra2x1,zebra4x2,document) because a Zebra loaded with 2x1" labels is a different target than one loaded with 4x2" labels. This brings the work center mapping fromzpl-print's config file into Carbon's database.Existing label routes untouched — downloads still work exactly as before
What Changes
@carbon/printingshared packagePrintingto the module enum for RLS-based access controlprinterRoutedatabase tablelabelSizesIDs (e.g.,zebra2x1,zebra4x2,document)printJobdatabase tablecompletedAt,origincolumn)/x/print-managerwith app-specific UIprint-job-generate(with idempotency keys) +print-job-deliversettings.models.tsgets autoPrint validator1 new shared package, 5 new files, 1 revised file, 9 files with small additions.
What Doesn't Change
file+/label routes (PDF/ZPL download still works)Future-Proofed
print-job-delivertask is the only code aware of how content reaches a printer. Adding support for CUPS, PrintNode, direct IPP, or any other target means adding a new delivery module — generation and the Print Manager UI are untouched.print-job-generatetask is the single point of content creation. Swapping in an external label API means changing one task — delivery and the Print Manager UI are untouched.cleanupcron task to prune old completed jobs.External Dependencies
Print Server — Print Delivery
Carbon is a cloud application. It cannot talk directly to USB or network printers on a customer's LAN. A print server acts as the local relay — Carbon sends label content (ZPL or PDF) over HTTPS, and the print server forwards it to the physical printer.
The delivery interface is generic: an HTTP POST with content to a printer endpoint URL, authenticated via API key. Any print server that exposes printers as HTTP endpoints can plug in.
Reference implementation: ProxyBox Zero — a small hardware device that sits on the local network and exposes connected printers as HTTP API endpoints. Other print servers (CUPS with an HTTP wrapper, PrintNode, direct IPP bridges) could be supported as sibling delivery modules in
@carbon/printing.How it integrates:
print-job-deliverTrigger.dev task sends content to a print server endpoint via a simple HTTP POST@carbon/printingWhat operators configure: Printer endpoint URLs and an API key — all in the Printing settings page.
Label Design — Label Generation
Carbon's label generation is currently hardcoded — 4 fixed sizes, no custom layouts, no template system, no designer. Users who need a different label layout or want to add a company logo have to change source code. This is a significant gap for a manufacturing system where every customer has different labeling requirements.
The generation interface is generic: the
print-job-generatetask is the single point of content creation. Any label design API that accepts template ID + data and returns rendered output (PDF, ZPL, PNG) can plug in.Reference implementation: Bindery Press — a label design and generation platform with a WYSIWYG designer, data binding, multi-format output (PDF + ZPL + PNG from one template), and broad barcode support (Code128, EAN-13, UPC-A, QR, DataMatrix). Other label design APIs with similar capabilities could be supported by swapping the generation logic in the same task.
How it integrates:
print-job-generatetask calls the label design API with a template ID, output format, and bound dataBeta Was this translation helpful? Give feedback.
All reactions