PHPackages                             html2pdf/html2pdf-2image - 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. html2pdf/html2pdf-2image

ActivePhp7-extension[PDF &amp; Document Generation](/categories/documents)

html2pdf/html2pdf-2image
========================

transfer html to pdf or image

1.0.0(7y ago)0125PHPPHP &gt;=7.0.0

Since May 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/huangchuping/html2pdf-2image)[ Packagist](https://packagist.org/packages/html2pdf/html2pdf-2image)[ RSS](/packages/html2pdf-html2pdf-2image/feed)WikiDiscussions dev Synced 3w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

html2pdf-html2image
===================

[](#html2pdf-html2image)

Transfer html to pdf or image using htmltopdf.

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

[](#requirements)

### PHP7

[](#php7)

\###htmltopdf

```
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 html2pdf/html2pdf-2image`

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

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

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

use \Html\Html2Pdf;
use \Html\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)

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

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

2611d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8243093?v=4)[huangchuping](/maintainers/huangchuping)[@huangchuping](https://github.com/huangchuping)

---

Top Contributors

[![huangchuping](https://avatars.githubusercontent.com/u/8243093?v=4)](https://github.com/huangchuping "huangchuping (8 commits)")[![huangZhengXuan](https://avatars.githubusercontent.com/u/15881540?v=4)](https://github.com/huangZhengXuan "huangZhengXuan (2 commits)")

---

Tags

pdfimagehtml

### Embed Badge

![Health badge](/badges/html2pdf-html2pdf-2image/health.svg)

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

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k36.7M151](/packages/spatie-browsershot)[kartik-v/yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

1693.3M36](/packages/kartik-v-yii2-export)[daandesmedt/phpheadlesschrome

A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.

92255.6k](/packages/daandesmedt-phpheadlesschrome)[scannerjs/scanner.js

ScannerJS: JavaScript web scan JPG PDF images from TWAIN WIA scanners in browser (Chrome, Edge, Firefox or IE)

5914.4k](/packages/scannerjs-scannerjs)[yetiforce/yetiforcepdf

Library that generate pdf files from html.

13128.9k1](/packages/yetiforce-yetiforcepdf)[karkowg/php-mupdf

Minimal PDF to image converter using MuPDF

203.4k](/packages/karkowg-php-mupdf)

PHPackages © 2026

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