Skip to content

CuAnnan/php-barcode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-barcode

Class based version of https://github.com/davidscotttufts/php-barcode/

The abstract Barcode class is responsible for all of the work except converting the plain text to encoded characters. The individual barcode type Classes implement the convertText method which generates the string of encoded text for barcodifying.

Usage:

<?php
spl_autoload_register(
	function($class)
	{
		$classParts = explode('\\', $class);
		$relativePath = implode('/', $classParts).'.class.php';
		$path = 'classes/'.$relativePath;
		if(is_file($path))
		{
			include $path;
			return true;
		}
		return false;
	}
);

$characterCodePrefix = "309";
$characterCode = "108";
$code = $characterCodePrefix.'-'.str_pad($characterCode, 6, '0', STR_PAD_LEFT);
$generator = new \Barcode\CodaBarBarcode($code);
$generator->displayPNG();
?>

About

Source code for the article "How To Create Barcodes in PHP" found at http://davidscotttufts.com/2009/03/31/how-to-create-barcodes-in-php/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%