yii2 使用barcode生成
使用前安装依赖
composer require picqer/php-barcode-generator
使用
$generator = new BarcodeGeneratorJPG();
$barcode = $generator->getBarcode('21212', $generator::TYPE_CODE_128, 2, 110);
$barcode = 'data:image/jpg;base64,' . base64_encode($barcode);