A Composer package that builds QR codes as PNG, WebP, SVG, EPS, or binary output with optional validation and Symfony integration.
Overview
This PHP library generates QR codes using bacon/bacon-qr-code for the matrix and can validate output with khanamiryan/qrcode-detector-decoder. Install it with Composer; image writers typically need the GD extension enabled.
A builder API and lower-level APIs configure content, size, margins, encoding, error correction, logos, and labels. Writers emit PNG, WebP, SVG, EPS, PDF placement, or raw binary, each with optional writer-specific settings. Round block size modes control how pixel rounding affects margins and sharpness.
Encoding choice affects scanner compatibility: UTF-8 supports broad character sets, while ISO-8859-1 can improve compatibility with some barcode readers. An optional validation reader re-reads generated codes to confirm payload accuracy at a performance cost.
Twig extensions, a factory, routes, and a separate Symfony bundle support framework integration. A companion bundle documents defaults, multiple configurations, URL generation, and Twig helpers.
Key features
- Builder-based QR creation
- PNG, WebP, SVG, EPS writers
- Configurable encoding and margins
- Logo and label support
- Optional output validation reader
- Twig extension support
- Symfony bundle available
- Writer-specific option constants
Use cases
- QR codes in PHP web apps
- Symfony-integrated QR endpoints
- Validated codes for critical payloads
- SVG or PNG assets for print