alberon/htmltopdf
最新稳定版本:1.0.1
Composer 安装命令:
composer require alberon/htmltopdf
包简介
HTML to PDF PHP wrapper with executable files
README 文档
README
PHP wrapper for wkhtmltopdf http://wkhtmltopdf.org/downloads.html
Install
-
Install Composer:
curl -s https://getcomposer.org/installer | php -
Add to your
composer.jsonfile:composer require alberon/htmltopdf
-
Usage Instructions:
// Require the PDF class at the top of the file require ABSPATH . '/../vendor/autoload.php'; use Alberon\htmltopdf\PDF; // Open up an ob buffer to capture all the following html ob_start(); // HTML CODE // Close the ob buffer and get the html into a variable $html = ob_get_clean(); // Setup the PDF class with the generated html $pdf = new PDF($html); // Set wkhtmltopdf version $pdf->setVersion('amd64'); // Set whether to include detailed errors or a generic error // $pdf->showErrors(); $pdf->hideErrors(); // Output the PDF $pdf->outputAsPDF('my_filename');
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-08