matias-vdv/gs1_barcode
Composer 安装命令:
composer require matias-vdv/gs1_barcode
包简介
Generate GS1-128 standard barcode
README 文档
README
The library generates GS1 barcode. Currently supported formats: GS1 128.
Install
Note that library requires both GD and Free Type extensions installed
composer install ayeo/gs1_barcode:1.0.*
Usage
The simplest example:
use Ayeo\Barcode; $builder = new Barcode\Builder(); $builder->output('(10)123456(400)11');
This will generate png image using black and white and default font
Custom barcode:
use Ayeo\Barcode; $builder = new Barcode\Builder(); $builder->setBarcodeType('gs1-128'); $builder->setFilename('barcode.png'); $builder->setImageFormat('png'); $builder->setWidth(500); $builder->setHeight(150); $builder->setFontPath('FreeSans.ttf'); $builder->setFontSize(15); $builder->setBackgroundColor(255, 255, 255); $builder->setPaintColor(0, 0, 0);
Finally, you can use the output method to stream the image directly to the web browser.
$builder->output('(10)123456(400)11');
If you want to save the image file, you can use the saveImage method instead.
$builder->saveImage('(10)123456(400)11');
Acctualy generate the dame barcode becouse all params all set to default values. This shows only available settings
Fluent interface is welcome
use Ayeo\Barcode; Barcode\Builder::build()->setWidth(600)->setBackgroundColor(100, 100, 100)->output('(10)123456(400)11');
Additional info
- Supported image formats: png, jpg
- Barcode must be valid GS1 barcode
Contributing
Everyone is welcome, feel free to join
Supported identifiers
The goal is to support all existing gs1 application identifiers but at the moment I have added only those I needed. Feel free to add or request some. Full list is here
| Code | Name | Min length | Max length |
|---|---|---|---|
| 00 | SERIAL SHIPPING CONTAINER CODE | 18 | 18 |
| 01 | GLOBAL TRADE ITEM NUMBER | 14 | 14 |
| 02 | ITEM TRADE ITEM NUMBER | 14 | 14 |
| 10 | BATCH NUMBER | 1 | 20 |
| 12 | PAYMENT DATE (YYMMDD) | 6 | 6 |
| 15 | BEST BEFORE DATE (YYMMDD) | 6 | 6 |
| 17 | EXPIRATION DATE (YYMMDD) | 6 | 6 |
| 37 | NUMBER OF UNITS CONTAINED | 1 | 8 |
| 3301 | CONTAINER GROSS WEIGHT (KG) | 6 | 6 |
| 390(n) | AMOUNT PAYABLE - SINGLE MONETARY AREA | 1 | 15 |
| 400 | CUSTOMER PURCHASE ORDER NUMBER | 1 | 30 |
| 415 | GLOBAL LOCATION NUMBER OF THE INVOICE PARTY | 13 | 13 |
| 8020 | PAYMENT SLIP REFERENCE NUMBER | 1 | 25 |
| 96 | COMPANY INTERNAL INFORMATION | 1 | 30 |
matias-vdv/gs1_barcode 适用场景与选型建议
matias-vdv/gs1_barcode 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.94k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 07 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「barcode」 「gs1」 「gs1-128」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 matias-vdv/gs1_barcode 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 matias-vdv/gs1_barcode 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 matias-vdv/gs1_barcode 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generate GS1-128 standard barcode
Library to support GS1 barcodes.
Bundle providing a password encoder stack for support of legacy user data.
Symfony 4, 5, 6 ,7 Barcode Generator Bundle with Twig function extension
Support for GS1 system
Generate GS1-128 standard barcode
统计信息
- 总下载量: 2.94k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-24