diff --git a/include/barcodes/datamatrix.php b/include/barcodes/datamatrix.php index d1cc6d2a..2c5bb754 100644 --- a/include/barcodes/datamatrix.php +++ b/include/barcodes/datamatrix.php @@ -3,8 +3,9 @@ // File name : datamatrix.php // Version : 1.0.008 // Begin : 2010-06-07 -// Last Update : 2014-05-06 +// Last Update : 2024-01-19 // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com +// Author : Urs Wettstein (implementation of rectangular code) // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // ------------------------------------------------------------------- // Copyright (C) 2010-2014 Nicola Asuni - Tecnick.com LTD @@ -121,6 +122,12 @@ class Datamatrix { */ protected $last_enc = ENC_ASCII; + /** + * Store whether the code is rectangular or not (square). + * @protected + */ + protected $rectangular = false; + /** * Table of Data Matrix ECC 200 Symbol Attributes: * @param string $code code to print - * @param string $type type of barcode: + * @param string $type type of barcode: */ public function __construct($code, $type) { $this->setBarcode($code, $type); @@ -246,7 +247,7 @@ public function getBarcodePngData($w=3, $h=3, $color=array(0,0,0)) { /** * Set the barcode. * @param string $code code to print - * @param string $type type of barcode: + * @param string $type type of barcode: * @return void */ public function setBarcode($code, $type) { @@ -255,7 +256,7 @@ public function setBarcode($code, $type) { switch ($qrtype) { case 'DATAMATRIX': { // DATAMATRIX (ISO/IEC 16022) require_once(dirname(__FILE__).'/include/barcodes/datamatrix.php'); - $qrcode = new Datamatrix($code); + $qrcode = new Datamatrix($code, count($mode) > 1 ? $mode[1] : 'S'); $this->barcode_array = $qrcode->getBarcodeArray(); $this->barcode_array['code'] = $code; break;