diff --git a/application/views/barcodes/Code128.php b/application/views/barcodes/Code128.php index 6a2dab226..07f09b389 100644 --- a/application/views/barcodes/Code128.php +++ b/application/views/barcodes/Code128.php @@ -12,8 +12,8 @@ namespace emberlabs\Barcode; /** - * emberlabs Barcode Creator - Code39 - * Generate Code39 Barcides + * emberlabs Barcode Creator - Code128 + * Generate Code128 Barcodes * * * @license http://opensource.org/licenses/mit-license.php The MIT License diff --git a/application/views/barcodes/Code39.php b/application/views/barcodes/Code39.php index 36ec535cb..7038bc9a4 100644 --- a/application/views/barcodes/Code39.php +++ b/application/views/barcodes/Code39.php @@ -13,7 +13,7 @@ namespace emberlabs\Barcode; /** * emberlabs Barcode Creator - Code39 - * Generate Code39 Barcides + * Generate Code39 Barcodes * * * @license http://opensource.org/licenses/mit-license.php The MIT License diff --git a/application/views/barcodes/Ean13.php b/application/views/barcodes/Ean13.php new file mode 100644 index 000000000..b700b9bbe --- /dev/null +++ b/application/views/barcodes/Ean13.php @@ -0,0 +1,81 @@ +data = $data; + } + + /* + * Draw the image + * + * @return void + */ + public function draw() + { + $this->img = @imagecreate($this->x, $this->y); + $white = imagecolorallocate($this->img, 255, 255, 255); + $black = imagecolorallocate($this->img, 0, 0, 0); + +/* + // Print the code + foreach($charAry as $k => $char) + { + $code = $this->getBar($char); + $checkSumCollector += $this->getKey($char) * $k; // $k will be 0 for our first + + foreach(str_split((string) $code) as $bit) + { + imagefilledrectangle($this->img, $currentX, 0, ($currentX + $pxPerBar), ($this->y - 1), (($bit == '1') ? $black : $white)); + $currentX += $pxPerBar; + } + } + + $ending[] = self::$barMap[$checkSumCollector % 103]; + $ending[] = self::$barMap[106]; // STOP. + + foreach($ending as $code) + { + foreach(str_split((string) $code) as $bit) + { + imagefilledrectangle($this->img, $currentX, 0, ($currentX + $pxPerBar), ($this->y - 1), (($bit == '1') ? $black : $white)); + $currentX += $pxPerBar; + } + } +*/ + } +} +?> \ No newline at end of file