leongrdic/pdf417
Composer 安装命令:
composer require leongrdic/pdf417
包简介
PDF417 barcode generation PHP library
README 文档
README
This is a fork of pdf417-php library by ihabunek, attempting to keep it's legacy alive as it appears to be the only open source PDF417 generation library for PHP. You can see the main differences below. It has been updated a bit mainly fixing a PHP 8.2 incompatibility issue and merging a few PRs. The idea is to eventually refactor all components and optimize the encoding algorithm. Thus, any contributions are more than welcome!
Requirements
- PHP 8.0+
- Extensions:
- fileinfo
- bcmath
- dom
- gd
- simplexml (for running tests)
Installation
composer require leongrdic/pdf417
Usage
$pdf417 = new \Le\PDF417\PDF417; $pdf417->setColumns(15); // optionally set the number of columns $pdf417->setSecurityLevel(4); // optionally set the security level $pdf417->setForceBinary(); // optionally force binary encoding $content = 'Lorem ipsum dolor sit amet.'; $data = $pdf417->encode($content); $imageRenderer = new \Le\PDF417\Renderer\ImageRenderer([ // below are default values 'format' => 'png', // jpg, png, gif, tif, bmp or data-url 'quality' => 90, // jpeg quality 1-100 'scale' => 3, // elements scale 1-20 'ratio' => 3, // height to width aspect 1-10 'padding' => 20, // padding in px 0-50 'color' => '#000000', // elements color hex code 'bgColor' => '#ffffff', // background color hex code ]); $image = ->render($data)->render($data); $image instanceof \Intervention\Image\Image; // true $svgRenderer = new \Le\PDF417\Renderer\SvgRenderer([ // below are default values 'scale' => 3, // elements scale 1-20 'ratio' => 3, // height to width aspect 1-10 'color' => 'black', // elements color ]); $svg = $svgRenderer->render($data);
Migration from ihabunek/pdf417-php
- Notable namespace changes
BigFish\PDF417\PDF417 => Le\PDF417\PDF417 BigFish\PDF417\Renderers\ImageRenderer => Le\PDF417\Renderer\ImageRenderer BigFish\PDF417\Renderers\SvgRenderer => Le\PDF417\Renderer\SvgRenderer
- Added types to all properties and method parameters and returns
Contributions
Please help this library by testing it and submitting PRs for any fixes or improvement. Thank you!
leongrdic/pdf417 适用场景与选型建议
leongrdic/pdf417 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44.97k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2023 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 leongrdic/pdf417 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 leongrdic/pdf417 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 44.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 25
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-13