phuonght/converter-document

此包的最新版本(v2.0.0)没有可用的许可信息。

支持将文档转换为其他格式

v2.0.0 2024-07-20 03:15 UTC

This package is auto-updated.

Last update: 2024-09-20 03:39:53 UTC


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