356 Generate Barcode

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).

Colours

Which barcode when?

TypeCharactersTypical use
Code 128All 128 ASCII charactersShipping labels, invoice / receipt numbers, SKUs - the best default
Code 39A-Z 0-9 - . $ / + % spaceOld systems, ID cards, asset tags; wider than Code 128
EAN-1312 digits + check digitRetail 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.