src
8 months ago
test
8 months ago
LICENSE
8 months ago
README.md
8 months ago
composer.json
8 months ago
phpunit.xml.dist
8 months ago
README.md
40 lines
| 1 | # QR Code generator |
| 2 | |
| 3 | [](https://github.com/Bacon/BaconQrCode/actions/workflows/ci.yml](https://github.com/Bacon/BaconQrCode/actions/workflows/ci.yml](https://github.com/Bacon/BaconQrCode/actions/workflows/ci.yml) |
| 4 | [](https://codecov.io/gh/Bacon/BaconQrCode](https://codecov.io/gh/Bacon/BaconQrCode](https://codecov.io/gh/Bacon/BaconQrCode) |
| 5 | [](https://packagist.org/packages/bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code) |
| 6 | [](https://packagist.org/packages/bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code) |
| 7 | [](https://packagist.org/packages/bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code](https://packagist.org/packages/bacon/bacon-qr-code) |
| 8 | |
| 9 | |
| 10 | ## Introduction |
| 11 | BaconQrCode is a port of QR code portion of the ZXing library. It currently |
| 12 | only features the encoder part, but could later receive the decoder part as |
| 13 | well. |
| 14 | |
| 15 | As the Reed Solomon codec implementation of the ZXing library performs quite |
| 16 | slow in PHP, it was exchanged with the implementation by Phil Karn. |
| 17 | |
| 18 | |
| 19 | ## Example usage |
| 20 | ```php |
| 21 | use BaconQrCode\Renderer\ImageRenderer; |
| 22 | use BaconQrCode\Renderer\Image\ImagickImageBackEnd; |
| 23 | use BaconQrCode\Renderer\RendererStyle\RendererStyle; |
| 24 | use BaconQrCode\Writer; |
| 25 | |
| 26 | $renderer = new ImageRenderer( |
| 27 | new RendererStyle(400), |
| 28 | new ImagickImageBackEnd() |
| 29 | ); |
| 30 | $writer = new Writer($renderer); |
| 31 | $writer->writeFile('Hello World!', 'qrcode.png'); |
| 32 | ``` |
| 33 | |
| 34 | ## Available image renderer back ends |
| 35 | BaconQrCode comes with multiple back ends for rendering images. Currently included are the following: |
| 36 | |
| 37 | - `ImagickImageBackEnd`: renders raster images using the Imagick library |
| 38 | - `SvgImageBackEnd`: renders SVG files using XMLWriter |
| 39 | - `EpsImageBackEnd`: renders EPS files |
| 40 |