PHPackages                             evanpurkhiser/kohana-html2pdf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. evanpurkhiser/kohana-html2pdf

AbandonedArchivedLibrary[PDF &amp; Document Generation](/categories/documents)

evanpurkhiser/kohana-html2pdf
=============================

A Kohana module to convert HTML to a PDF document using wkhtmltopdf as the conversion backend

8191PHP

Since May 6Pushed 12y ago1 watchersCompare

[ Source](https://github.com/EvanPurkhiser/kohana-HTML2PDF)[ Packagist](https://packagist.org/packages/evanpurkhiser/kohana-html2pdf)[ RSS](/packages/evanpurkhiser-kohana-html2pdf/feed)WikiDiscussions 3.3/master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

### HTML2PDF Document converter

[](#html2pdf-document-converter)

HTML2PDF is a Kohana 3.x module that can be used to convert a HTML document into a PDF document. This module uses the [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/)as a back-end to handle the conversions.

#### Requirements

[](#requirements)

You must have the [wkhtmltopdf](http://wkhtmltopdf.org/) static binary (at least version 0.10 RC1) installed onto your machine and in the PATH read by the user executing the PHP application

#### Usage

[](#usage)

You can create a PDF document from HTML like so (Optionally specifying the HTML content)

```
$document = HTML2PDF::document($html)

```

From here you can apply some different formatting options to the document including

- `$document->body($html)` - Set the HTML body content of the PDF
- `$document->header($html)` - Set the HTML to render at the top of each page
- `$document->header_spacing($spacing)` - Set the spacing between the content and header
- `$document->margins($top, $left, $bottom, $right)` - Set the margins for the document (in millimeters)

See the [class itself](classes/Kohana/HTML2PDF/Document.php) for all the available methods.

Finally you can then render the document as a PDF two different ways. You can eaither save the PDF to a file on the file-system, or you can convert the PDF and have the PDF BLOB returned.

```
// Save to the filesystem
$document->save('/home/evan/document.pdf');

// Save to filesystem and return temporary file path
$temp_path = $document->save();

// Convert and put the BLOB into a variable
$pdf_blob = $document->convert();

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1421724?v=4)[Evan Purkhiser](/maintainers/EvanPurkhiser)[@evanpurkhiser](https://github.com/evanpurkhiser)

---

Top Contributors

[![evanpurkhiser](https://avatars.githubusercontent.com/u/1421724?v=4)](https://github.com/evanpurkhiser "evanpurkhiser (31 commits)")[![rowanparker](https://avatars.githubusercontent.com/u/331336?v=4)](https://github.com/rowanparker "rowanparker (5 commits)")[![mauserrifle](https://avatars.githubusercontent.com/u/1580250?v=4)](https://github.com/mauserrifle "mauserrifle (3 commits)")

### Embed Badge

![Health badge](/badges/evanpurkhiser-kohana-html2pdf/health.svg)

```
[![Health](https://phpackages.com/badges/evanpurkhiser-kohana-html2pdf/health.svg)](https://phpackages.com/packages/evanpurkhiser-kohana-html2pdf)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
