pplb 0.1.0
pplb: ^0.1.0 copied to clipboard
Pure-Dart PPLB (Printer Programming Language B) command generator for ARGOX / EPL2-family label printers. Builds label byte streams; transport-agnostic.
pplb #
Pure-Dart PPLB (Printer Programming Language B) command generator for ARGOX / EPL2-family label printers. It builds the label byte stream; you send it over whatever transport you have. No FFI, no platform dependency — runs on every Dart target (server, CLI, Flutter desktop/mobile, web).
PPLB is ARGOX's command language, closely modeled on EPL2. This package emits raw PPLB bytes — it does not drive ZPL (Zebra), TSPL (TSC), or ESC/POS (Epson) printers. For a ready Windows USB transport, see
argox_ix4.
Usage #
import 'dart:convert';
import 'package:pplb/pplb.dart';
void main() {
final label = CommandLabel(const [
BufferClear(), // N
LabelDimensions(length: 100, gap: 20), // Q
Text(x: 50, y: 30, font: 3, data: 'PPLB'), // A
Barcode1d(x: 50, y: 80, type: '1', height: 60, // B (Code128)
data: '0123456789'),
Barcode2d.qr(x: 50, y: 150, data: 'https://x'), // b (QR)
Copies(1), // P
]);
final bytes = label.bytes(); // send these over your transport
print(ascii.decode(bytes));
}
Flutter consumers: this library exports a class named
Text(the PPLBAcommand), which clashes withpackage:flutter/material.dart. Import with a prefix:import 'package:pplb/pplb.dart' as pplb;
What's included #
- Commands:
Text(A),Barcode1d(B),Barcode2d.qr(b),Box(X),Line(LO),LabelDimensions(Q),LabelWidth(q),Origin(R),PrintSpeed(S),Darkness(D),PrintDirection(Z),BufferClear(N),Copies(P),ImmediateStatus(^ee),Enable/DisableErrorReport(US/UN). Label/CommandLabel— compose commands into one program.PrinterStatuswithPplbStatus(maps^eecodes:07/50→ media-out,11→ head-open,12→ paused) andSafeStatus(never throws across the seam).pplbStatusCodeparses a raw^eereply.Printerseam (transport contract) withLoggedPrinter/RetryPrinterdecorators and aConstPrinterfake for tests.
License #
MIT — see LICENSE.