jfilla / php-barcode-generator
An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.
Installs: 6 873
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-11-29 05:09:39 UTC
README
This is an easy to use, non-bloated, framework independent, barcode generator in PHP.
It creates PNG from the most used 1D barcode standards.
- The codebase is largely from the picqer/php-barcode-generator by Casper Bakker.
Prerequisities
- GD Library installed
Installation
Install through composer:
composer require jfilla/php-barcode-generator
Usage
Initiate the barcode generator for the output you want, then call the ->getBarcode() routine as many times as you want.
$generator = new Picqer\Barcode\BarcodeGeneratorPNG(); echo $generator->getBarcode('081231723897', $generator::TYPE_CODE_128);
The ->getBarcode() routine accepts the following:
- $code Data for the barcode
- $type Type of barcode, use the constants defined in the class
- $widthFactor Width is based on the length of the data, with this factor you can make the barcode bars wider than default
- $totalHeight The total height of the barcode
- $color Hex code of the foreground color
- $showCode Display barcode content as text