AtelierBarcode
Generate scan-ready barcodes as crisp SVG.
Generate QR codes, Code 128, and EAN-13 as crisp SVG in pure PHP. The encoder returns the markup directly - no canvas, browser, or runtime dependency.
Features
- Fifteen symbologies
QR, Data Matrix, GS1 DataMatrix, EAN-13, EAN-8, UPC-A, UPC-E, ISBN, Code 39, Code 93, Code 128, GS1-128, ITF-14, Interleaved 2 of 5 and Codabar. - QR to the standard
Versions 1 to 40, numeric, alphanumeric or byte mode chosen from the payload, four error-correction levels, and all eight masks scored before one is picked. - Check digits and guards
EAN, UPC and ISBN validate or compute the check digit. Code 39 takes a Mod 43 checksum, ITF-14 draws bearer bars, and Codabar takes explicit A to D guards. - SVG, PNG or GIF
One symbol, three outputs, from the same computed geometry. GIF is assembled byte by byte in PHP; PNG is the one call that needsext-gd. - The grid, not only the markup
A matrix code returns its grid as rows of booleans frommatrix(), a linear one its bar widths frommodules(), for composing into a document or rendering elsewhere. - Quiet zone, colour, size
Every builder sharesmargin(),foreground()andbackground(). Matrix codes takesize(); linear ones takescale()andheight().
Create a QR Code
use Atelier\Barcode\Ecc;
use Atelier\Barcode\QrCode;
$svg = QrCode::create('https://ateliersvg.com')
->ecc(Ecc::Medium)
->size(240)
->margin(4)
->render();
Every builder returns SVG markup ready for an <img>, inline SVG, PDF, or email.
Make a product barcode
use Atelier\Barcode\Ean13;
$svg = Ean13::create('590123412345') // computes the check digit
->scale(2)
->height(80)
->render();
Configuration
QR codes offer Ecc::Low, Ecc::Medium, Ecc::Quartile, and Ecc::High. All builders expose a quiet-zone margin and foreground and background colours; linear codes add module scale and bar height. matrix() returns the module grid as booleans instead of SVG, which is what the PNG and GIF renderers take.
Documentation
Start
- Installation: install the package and verify the runtime.
- Getting started: render a first symbol and catch a failure.
Symbologies
- Every symbology: compare the fifteen and pick one.
- Matrix codes: QR Code, Data Matrix, GS1 DataMatrix.
- Retail and publishing: EAN-13, EAN-8, UPC-A, UPC-E, ISBN.
- Logistics and general purpose: Code 128, GS1-128, ITF-14, Interleaved 2 of 5, Code 39, Code 93, Codabar.