tanvirismail/barcode
最新稳定版本:v1.0.0
Composer 安装命令:
composer require tanvirismail/barcode
包简介
laravel Barcode package
README 文档
README
supported barcode format: CODE39, CODE128
use TanvirIsmail\Barcode\Barcode; $barcode = new Barcode; $barcode->code('200300001'); $barcode->type('code39'); // code39, code128 $barcode->height(100); $barcode->barWidth(2); $barcode->margin(10); $barcode->background([255, 255, 255]); // transparent = [0, 0, 0, 127] $barcode->barColor([[0, 0, 0],[255, 255, 255]]); $barcode->showcode(); $barcode->label('barcode'); $barcode->labelPosition('right'); // center , left, right
response as image
$barcode->responseHeader(); echo $barcode->build(); // for laravel response($barcode->build())->header('Content-Type', $barcode->getContentType());
view as image
echo '<img src="data:image/png;base64,' . base64_encode($barcode->build()) . '">';
save
$barcode->extension('png'); // jpeg, png $barcode->path('barcode.png'); // path with file name $barcode->save();
download
$barcode->download(); // if download as file name $barcode->extension('png'); // default 'png' $barcode->download('test'); // file name without extention
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-16
