Monday, August 12, 2013

PHP Barcode Generator

Here is an easy to use PHP barcode generator class.
Requirements: PHP Web server and GD Library (Graphics Library).

The PHP class will create a GIF barcode image or save a GIF barcode image file, here is an example:// include Barcode39 class 
include 
"BarCode.php"; 
// set Barcode39 object 
$bc 
= new Barcode39("AB3740-45"); 
// display new barcode 
$bc
->draw();
This example will output this barcode:






You can also easily adjust the barcode bar sizes and text size:// set object 
$bc 
= new BarCode("AB33740-45"); 
// set text size 
$bc
->barcode_text_size = 5; 
// set barcode bar thickness (thick bars) 
$bc
->barcode_bar_thick = 4; 
// set barcode bar thickness (thin bars) 
$bc
->barcode_bar_thin = 2; 
// save barcode GIF file 
$bc
->draw("barcode.gif");
This example will save this barcode as "barcode.gif": 





http://www.shayanderson.com/php/php-barcode-generator-class-code-39.htm

No comments:

Post a Comment