waarneembemiddeling / php-pdftoppm
0.0.1
2015-07-09 09:27 UTC
Requires
- alchemy/binary-driver: ~1.5
Requires (Dev)
- phpunit/phpunit: ~4.0
- symfony/http-foundation: v2.5.0
This package is not auto-updated.
Last update: 2024-09-11 09:44:17 UTC
README
PHP 对 pdftoppm 命令 的包装,该命令是 poppler-utils 的一部分。
Pdftoppm 是一个处理将 PDF 文件转换为图像的库。它在各种系统上可用。
可用的软件包: http://pkgs.org/download/poppler-utils
用法
use Wb\PdfToPpm\PdfToPpm;
$pdfToPpm = PdfToPpm::create();
// $result is an instance of \FilesystemIterator
$result1 = $pdfToPpm->convertPdf('path/to/pdf');
$result2 = $pdfToPpm->convertPdf('path/to/pdf', 'path/to/other/destination/dir/then/tmp');
// Save as png
$result3 = $pdfToPpm->convertPdf('path/to/pdf', 'path/to/other/destination/dir/then/tmp', true);
// Set specific resolution
$result4 = $pdfToPpm->convertPdf('path/to/pdf', 'path/to/other/destination/dir/then/tmp', true, 300);
测试
cp phpunit.xml.dist phpunit.xml
如有必要,请修改 phpunit.xml 中的 env
binary
指令。
composer install
php vendor/bin/phpunit