Generate Barcode
Type a value and pick a symbology. ZXing encodes it, the server draws a PNG (for screens and Office) or an SVG (vector - sharp on any printer and label size).
Which barcode when?
| Type | Characters | Typical use |
|---|---|---|
| Code 128 | All 128 ASCII characters | Shipping labels, invoice / receipt numbers, SKUs - the best default |
| Code 39 | A-Z 0-9 - . $ / + % space | Old systems, ID cards, asset tags; wider than Code 128 |
| EAN-13 | 12 digits + check digit | Retail products (GS1 registered numbers) |
How it works
BitMatrix m = new MultiFormatWriter().encode("PD-2026-000351", BarcodeFormat.CODE_128, 420, 140, hints);
BufferedImage img = MatrixToImageWriter.toBufferedImage(m); // PNG
// SVG: walk the matrix and write one rectangle per run of black modules
for (int x = 0; x < m.getWidth(); x++) if (m.get(x, 0)) svg.append("M" + x + " 0h1v" + h + "h-1z");
Endpoints: /api/barcode.png?type=CODE_128&text=..., /api/barcode.svg. They are also used
inside invoices, receipts, labels and templates. Files: service/BarcodeService.java, web/FileController.java.