Source for file BarcodeObject
Documentation is available at BarcodeObject
//============================================================+
// File name : i25aobject.php
// Last Update : 2004-12-29
// Author : Karim Mribti [barcode@mribti.com]
// : Nicola Asuni [info@tecnick.com]
// Version : 0.0.8a 2001-04-01 (original code)
// License : GNU LGPL (Lesser General Public License) 2.1
// http://www.gnu.org/copyleft/lesser.txt
// Source Code : http://www.mribti.com/barcode/
// Description : I25 Barcode Render Class for PHP using
// the GD graphics library.
// Interleaved 2 of 5 is a numeric only bar code
// with a optional check number.
// This version contains changes by Nicola Asuni:
// - code style and formatting
// - automatic php documentation in PhpDocumentor Style
//============================================================+
* I25 Barcode Render Class for PHP using the GD graphics library.<br<
* Interleaved 2 of 5 is a numeric only bar code with a optional check number.
* @author Karim Mribti, Nicola Asuni
* @package linea21.externals
* @subpackage com.tecnick.tcpdf
* @version 0.0.8a 2001-04-01 (original code)
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* I25 Barcode Render Class for PHP using the GD graphics library.<br<
* Interleaved 2 of 5 is a numeric only bar code with a optional check number.
* @author Karim Mribti, Nicola Asuni
* @package linea21.externals
* @subpackage com.tecnick.tcpdf
* @version 0.0.8a 2001-04-01 (original code)
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @param int $Width Image width in pixels.
* @param int $Height Image height in pixels.
* @param int $Style Barcode style.
* @param int $Value value to print on barcode.
public function __construct($Width, $Height, $Style, $Value) {
* @param int $xres Horizontal resolution.
private function GetSize($xres) {
for ($i= 0;$i< $len;$i++ ) {
if ((ord($this->mValue[$i])< 48) || (ord($this->mValue[$i])> 57)) {
$this->mError = "I25 is numeric only";
$this->mError = "The length of barcode value must be even";
$c1 = $this->mValue[$cPos];
$c2 = $this->mValue[$cPos+ 1];
$sPos += ($type1 + $type2);
return $sPos + $StartSize + $StopSize;
* @param int $DrawPos Drawing position.
* @param int $yPos Vertical position.
* @param int $ySize Vertical size.
* @param int $xres Horizontal resolution.
* @return int drawing position.
private function DrawStart($DrawPos, $yPos, $ySize, $xres) {
/* Start code is "0000" */
* @param int $DrawPos Drawing position.
* @param int $yPos Vertical position.
* @param int $ySize Vertical size.
* @param int $xres Horizontal resolution.
* @return int drawing position.
private function DrawStop($DrawPos, $yPos, $ySize, $xres) {
* Draws the barcode object.
* @param int $xres Horizontal resolution.
* @return bool true in case of success.
if (($size = $this->GetSize($xres))== 0) {
for ($i= 0;$i< $len;$i++ ) {
$c1 = $this->mValue[$cPos];
$c2 = $this->mValue[$cPos+ 1];
$sPos += ($type1 + $type2);
//============================================================+
//============================================================+
|