2017 © Pedro Peláez
 

library html2pdf

Common interface for converting HTML documents to PDF using adapters

image

brs-software/html2pdf

Common interface for converting HTML documents to PDF using adapters

  • Wednesday, December 23, 2015
  • by tobo-pl
  • Repository
  • 0 Watchers
  • 0 Stars
  • 531 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

BrsHtml2Pdf

Common interface for converting HTML documents to PDF using adapters., (*1)

Available adapters

  • Wkhtmltopdf - for debian and ubuntu install: http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-precise-amd64.deb. Version available in official packages is obsolete and require xvfb-run.

Examples

Example for Wkhtmltopdf adapter

<?php
use Brs\Html2Pdf\Html2Pdf;
use Brs\Html2Pdf\Adapter\Wkhtmltopdf;

// you can optionally test the environment
Wkhtmltopdf::testEnv();

$adapter = new Wkhtmltopdf;

// you can change path to binary on your server
$adapter->getWkhtmltopdfCmd()
    ->setPrefix('/special/path/to/whhtmltopdf')
;

// add wkhtmltopdf parameter
$adapter->getWkhtmltopdfCmd()
    ->add('--ignore-load-errors')
    ->add('--lowquality')
;

// if you must to use xvfb-run you can configure it
$adapter->getXvfbCmd()
    ->setPrefix('/special/path/to/xvfb-run')
    ->setArguments(['--server-args=-screen 0, 800x600x24'])
;

$converter = new Html2Pdf($adapter);

// set html file to convert
$converter->setHtmlFile('path/to/document.html');
// or html string
$converter->setHtmlDocument('
<html>
    <body>
        <strong>test pdf</strong>
    </body>
</html>
');
// or url
$converter->setUrl('http://google.com');

// generate the pdf file
$pdf = $converter->getPdfFile();

// send to client for download
$pdf->sendToBrowser('file.pdf');

// or save as local file
$pdf->saveAs('some/path/to/file.pdf');

Requirments

  • PHP 5.4 or higher

The Versions

23/12 2015

dev-master

9999999-dev https://github.com/brssoftware/Html2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

23/12 2015

v1.1.0

1.1.0.0 https://github.com/brssoftware/Html2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

23/12 2015

v1.0.7

1.0.7.0 https://github.com/brssoftware/Html2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

04/12 2015

v1.0.6

1.0.6.0 https://github.com/brssoftware/Html2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

15/10 2015

v1.0.5

1.0.5.0 https://github.com/brssoftware/Html2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

13/10 2015

v1.0.3

1.0.3.0 https://github.com/brssoftware/BrsHtml2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

13/10 2015

v1.0.2

1.0.2.0 https://github.com/brssoftware/BrsHtml2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

12/10 2015

v1.0.1

1.0.1.0 https://github.com/brssoftware/BrsHtml2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs

12/10 2015

v1.0

1.0.0.0 https://github.com/brssoftware/BrsHtml2Pdf

Common interface for converting HTML documents to PDF using adapters

  Sources   Download

The MIT License

The Requires

 

The Development Requires

html pdf wkhtmltopdf brs