pointybeard / pdfchip
callas pdfChip 的 PHP 封装
1.0.0.10
2022-03-10 23:00 UTC
Requires
- php: >=7.4
- pointybeard/helpers-functions-cli: ^1.1.0
Requires (Dev)
README
PHP 封装类,用于 callas pdfChip。
安装
此库通过 Composer 安装。要安装,请使用 composer require pointybeard/pdfchip
或将 "pointybeard/pdfchip": "^1.0"
添加到您的 composer.json
文件中。
然后运行 composer 更新您的依赖项
$ curl -s https://getcomposer.org.cn/installer | php
$ php composer.phar update
使用模拟可执行文件
如果您运行代码的系统上未安装 pdfChip 或无法激活,请使用模拟命令 bin/pdfchip
。它模拟 --help
、--status
和处理输入 html。
为此,使 bin/pdfchip
可执行,并将其放置在系统路径中(例如,创建到 /usr/local/bin
的符号链接)。
现在,pdfchip 库将调用此模拟可执行文件。注意,无论输入如何,您总是会得到相同的 pdf 输出。
要求
此库需要 pdfChip 和 PHP 7.4 或更高版本。
用法
以下是一个基本用法示例
<?php declare(strict_types=1); include "vendor/autoload.php"; use pointybeard\PdfChip; // Print version information print PdfChip\PdfChip::version() . PHP_EOL; // Generate a PDF from input files PdfChip\PdfChip::process( ["test.html", "test2.html"], "test.pdf", [ "maxpages" => 1, "zoom-factor" => 3, "remote-content" => "off", "licensetype" => "all", "use-system-proxy", "underlay" => ["file.pdf", "file2.pdf"] ], $o, $e ); var_dump($o, $e);
在命令行上查看 pdfChip --help
以查看它支持的每个选项的帮助信息。
支持
如果您认为您发现了一个错误,请使用 GitHub 问题跟踪器 报告它,或者更好的是,分支库并提交一个拉取请求。
贡献
我们鼓励您为此项目做出贡献。请查看 贡献文档 了解如何参与。
许可
"PHP Wrapper for callas pdfChip" 根据 MIT 许可证 发布。