定制 alberon/htmltopdf 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Install Composer:

    curl -s https://getcomposer.org/installer | php
  2. Add to your composer.json file:

    composer require alberon/htmltopdf
  3. 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

GitHub 信息

  • Stars: 2
  • Watchers: 8
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-08