Download the PHP package brewerwall/php-barcode-generator without Composer
On this page you can find all versions of the php package brewerwall/php-barcode-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brewerwall/php-barcode-generator
More information about brewerwall/php-barcode-generator
Files in brewerwall/php-barcode-generator
Package php-barcode-generator
Short Description An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.
License LGPL-3.0-only
Homepage http://github.com/brewerwall/php-barcode-generator
Informations about the package php-barcode-generator
PHP Barcode Generator
This is an easy to use, non-bloated, framework independent, barcode generator in PHP. This version has been updated to follow PSR-4 and work with PHP 7.1+.
It creates SVG, PNG, JPG and HTML images, from the most used 1D barcode standards.
The codebase is largely from the TCPDF barcode generator by Nicola Asuni. This code is therefor licensed under LGPLv3. It is still a bit of a mess, bit I will clean it in the future. I do not expect the interface of this class will change during the clean ups.
This codebase, also extending off of TCPDF barcode generator is a mostly direct copy from Picqer barcode generator. Updated to be php 7.1+ compliant.
Installation
Install through composer:
If you want to generate PNG or JPG images, you need the GD library or Imagick installed on your system as well.
Using IMB Barcodes require bcmath
extension to be installed as well.
Usage
Create a new barcode generator. This will declare the code, the type of barcode and what format the code will be rendered.
The $generator->generate()
method accepts the following parameters:
$code
Barcode value we need to generate.$widthFactor
(default: 2) Width is based on the length of the data, with this factor you can make the barcode bars wider than default$totalHeight
(default: 30) The total height of the barcode$color
(default: #000000) Hex code of the foreground color
Image types
Accepted types
Examples
Embedded PNG image in HTML: