phuonght / converter-document
此包的最新版本(v2.0.0)没有可用的许可信息。
支持将文档转换为其他格式
v2.0.0
2024-07-20 03:15 UTC
Requires
- ext-pcntl: *
- guzzlehttp/guzzle: ^6.0|^7.0
- hocvt/php-apache-tika: ^0.9.2
- illuminate/filesystem: ^10.0
- illuminate/support: ^10.0
- nelexa/zip: ^4.0
- phuonght/mimey: ^v1.0.0
- symfony/finder: ^6.0
- symfony/mime: ^6.0
- symfony/process: ^5.4|^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^8.0
- symfony/var-dumper: ^4.3
README
- Poppler 工具包
- Jod 转换器
使用方法
$converter = new \Colombo\Converters\Helpers\Converter(); $converter->setInput($input); // force custom converter $converter->setOutputFormat( 'pdf'); $converter->setEndPage(1); $converter->setEndPage(2); $result = $converter->run(); if($result->isSuccess()){ $result->saveTo('xxx.pdf'); }else{ print_r($result->getErrors()); }
与 Laravel 一起使用
-
将
ConverterServiceProvider
添加到 app.php 并输入以下命令php artisan colombo_convert -i ~/Downloads/30325685_1545065160.doc -f pdf --output ./x.pdf
稳定
- poppler 工具
- gs
- pdf2htmlex
待办事项
-[ ] 添加 ghostscript 以优化 PDF 文件 -[ ] 添加 qpdf -[ ] 添加 mupdf 以捕获 PDF