carl-gq/convert-html

the package of gsdata

dev-master 2019-12-11 08:58 UTC

This package is auto-updated.

Last update: 2024-03-25 17:39:55 UTC


README

安装, 暂时是dev版, composer安装时需要在最后加上:dev-master

composer require carl-gq/convert-html:dev-master

使用

$model = new \CarlGq\ConvertOffice\HtmlConvert();

转换word(doc格式)
$model->toWord($html, $path);

转换pdf
$model->toPdf($html,$path);

$html内容是html内容
$path是转换的文件保存位置

转换pdf需要赋予APP_PATH/vender/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64执行权限