Added support for Code128 barcode.

This commit is contained in:
Jan Böhmer 2020-05-07 23:27:40 +02:00
parent c58b36e9c5
commit f64910374f
5 changed files with 14 additions and 5 deletions

View file

@ -50,14 +50,15 @@ class BarcodeGenerator
case 'code93':
$type = 'C93';
break;
case 'code128':
$type = 'C128A';
break;
case 'none':
return null;
default:
throw new \InvalidArgumentException('Unknown label type!');
}
$bobj = $barcode->getBarcodeObj($type, $this->getContent($options, $target));
return $bobj->getSvgCode();
@ -71,6 +72,7 @@ class BarcodeGenerator
return $this->barcodeContentGenerator->getURLContent($target);
case 'code39':
case 'code93':
case 'code128':
return $this->barcodeContentGenerator->get1DBarcodeContent($target);
case 'none':
return null;