Atelier

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.

A QR symbol generated directly as SVG, including its quiet zone.

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 needs ext-gd.
  • The grid, not only the markup
    A matrix code returns its grid as rows of booleans from matrix(), a linear one its bar widths from modules(), for composing into a document or rendering elsewhere.
  • Quiet zone, colour, size
    Every builder shares margin(), foreground() and background(). Matrix codes take size(); linear ones take scale() and height().

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

Symbologies

Output

  • Renderers: emit SVG, GIF, or PNG from one symbol.
  • Options: set size, quiet zone, colour, and text.