vianetz/pdf-generator
Composer 安装命令:
composer require vianetz/pdf-generator
包简介
A library that supports method for generating PDF documents based on DomPdf and FPDI.
README 文档
README
This library offers an easy-to-use API for PDF generation and merging.
Internally it uses the DomPDF library for PDF generation and FPDI for merging.
More information about this PDF API can also be found on my website.
Usage
Create PDF document from HTML contents
// Create a new pdf instance. $pdf = \Vianetz\Pdf\Model\PdfFactory::general()->create(); // Create the document. You can return any kind of HTML content here. $document = new \Vianetz\Pdf\Model\HtmlDocument('<strong>Hello</strong> World!'); // Add our document to the pdf. You can add as many documents as you like // as they will all be merged into one PDF file. $pdf->add($document); // Save the resulting PDF to file test.pdf - That's it :-) $pdf->saveToFile('test.pdf');
Merge a PDF file and a PDF string into one PDF file
// Load some random PDF contents $pdfString = file_get_contents('test1.pdf'); // Setup things $pdfMerge = \Vianetz\Pdf\Model\PdfMerge::create(); // Do the merge. $pdfMerge->mergePdfString($pdfString, 'background.pdf'); $pdfMerge->mergePdfFile('test2.pdf'); // Save the result PDF to file result.pdf. file_put_contents($fileName, $pdfMerge->toPdf());
Tips & Tricks
- The string literal
__PDF_TPC__will be replaced with the total page count
Frequently Asked Questions
Please find the Frequently Asked Questions on my website.
Support
If you have any issues or suggestions with this extension, please do not hesitate to contact me.
License
GNU General Public License v3.0
See also LICENSE file.
This extension uses the DomPDF library. For license information please visit the DomPdf
repository.
This extension uses the FPDI library. For license information please visit the FPDI
repository.
This library uses Semantic Versioning - please find more information at semver.org.
vianetz/pdf-generator 适用场景与选型建议
vianetz/pdf-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 33.55k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pdf」 「vianetz」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vianetz/pdf-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vianetz/pdf-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vianetz/pdf-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The vianetz Magento core library that provides some utility methods for all our Magento extensions.
A Magento 1 extension to attach PDF documents to emails.
A Magento 1 extension to attach PDF documents to emails.
A Magento 1 extension that provides several small helper utilities.
Provides TCPDF integration for Symfony
The vianetz AsyncQueue Magento 1 Extension.
统计信息
- 总下载量: 33.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2017-05-06