PHPackages                             biaoqianwo/php-htmltopdf-htmltoimage - 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. biaoqianwo/php-htmltopdf-htmltoimage

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

biaoqianwo/php-htmltopdf-htmltoimage
====================================

transfer html to pdf or image

1.1.2(8y ago)122.6k4[1 issues](https://github.com/biaoqianwo/php-htmltopdf-htmltoimage/issues)MITPHPPHP &gt;=7.0.0

Since Aug 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/biaoqianwo/php-htmltopdf-htmltoimage)[ Packagist](https://packagist.org/packages/biaoqianwo/php-htmltopdf-htmltoimage)[ RSS](/packages/biaoqianwo-php-htmltopdf-htmltoimage/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

php-htmltopdf-htmltoimage
=========================

[](#php-htmltopdf-htmltoimage)

Transfer html to pdf or image using wkhtmltopdf.

Requirements
------------

[](#requirements)

### PHP7

[](#php7)

\###wkhtmltopdf

```
cd /tmp
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz && rm wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
ln -s -T /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf && \
chmod a+x /usr/local/bin/wkhtmltopdf &&  \
ln -s -T /tmp/wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage && \
chmod a+x /usr/local/bin/wkhtmltoimage

```

Check and get help by `wkhtmltopdf -h` or `wkhtmltoimage -h`
More information to see:

Install
-------

[](#install)

`composer require biaoqianwo/php-htmltopdf-htmltoimage`

Quick Start and Examples
------------------------

[](#quick-start-and-examples)

```
require __DIR__ . '/vendor/autoload.php';

use \Biaoqianwo\Html2Pdf\Html2Pdf;
use \Biaoqianwo\Html2Pdf\Html2Image;

$html = 'export......';
// or
// $html = file_get_contents('http://google.com');

// Pdf
$generator = new Html2Pdf('/usr/local/bin/wkhtmltopdf');
$options = ['header'=>'Centered header text','footer'=>'Left aligned footer text'];
$generator->getOutputFromHtml($html, $options)

// Image
$generator = new Html2Image('/usr/local/bin/wkhtmltoimage');
$options = ['format'=>'png','width'=>'300','height'=>'1000'];
$generator->getOutputFromHtml($html, $options)

```

More
----

[](#more)

You can improve `getHeader()` 、 `getFooter()`.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65043553783e26857146cd82158daf7f77db1d2ad7117cfe342716b3ff4740db?d=identicon)[biaoqianwo](/maintainers/biaoqianwo)

---

Top Contributors

[![biaoqianwo](https://avatars.githubusercontent.com/u/3367795?v=4)](https://github.com/biaoqianwo "biaoqianwo (9 commits)")

---

Tags

html2imagehtml2pdfhtmltoimagehtmltopdfphpwkhtmltopdf

### Embed Badge

![Health badge](/badges/biaoqianwo-php-htmltopdf-htmltoimage/health.svg)

```
[![Health](https://phpackages.com/badges/biaoqianwo-php-htmltopdf-htmltoimage/health.svg)](https://phpackages.com/packages/biaoqianwo-php-htmltopdf-htmltoimage)
```

###  Alternatives

[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.9k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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