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

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

ilovegits/html2pdf
==================

Html2Pdf is a HTML to PDF converter written in PHP5 (it uses TCPDF). OFFICIAL PACKAGE

v4.6.1(10y ago)069LGPLPHPPHP &gt;=5.3.2

Since Dec 11Pushed 9y agoCompare

[ Source](https://github.com/ilovegits/pdf)[ Packagist](https://packagist.org/packages/ilovegits/html2pdf)[ Docs](http://html2pdf.fr/)[ RSS](/packages/ilovegits-html2pdf/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

Html2Pdf
========

[](#html2pdf)

Latest stable release : v4.6.0 (2016-03-30)

How to use:
-----------

[](#how-to-use)

### Requirements

[](#requirements)

HTML2PDF works with PHP 5.3.2 and above.

### Installation

[](#installation)

This package can be installed in your project through composer.

```
composer require spipu/html2pdf

```

If you wish to try html2pdf outside a main project, you can just clone the project and run composer:

```
git clone https://github.com/spipu/html2pdf.git
cd html2pdf
composer install

```

### Recommendations

[](#recommendations)

- Look at the examples provided to see how it works.
- It is very important to provide valid HTML 4.01 to the converter, but only what is in the ``. Use the `` tag.
- for borders: it is advised that they are like `solid 1mm #000000`
- for padding, they are applicable only on tags `table`, `th`, `td`, `div`, `li`
- A default font can be specified, if the requested font does not exist or if no font is specified:

`$html2pdf->setDefaultFont('Arial');`

- The possibility to protect your PDF is present, CF Example 7.
- Some tests can be enabled (true) or disabled (false):
- `setTestIsImage` method: test that images must exist
- `setTestTdInOnePage` method: test that the contents of TDs fit on one page
- A DEBUG mode to know the resources used is present. It is activated by adding the following command just after the contructor (see Example 0): `$htmlpdf->setModeDebug();`
- Some specific tags have been introduced:

    - `` (CF Exemple 7 &amp; wiki)

        - Determines the orientation, margins left, right, top and bottom, the background image
        - and the background color of a page, its size and position, the footer.
        - It is also possible to keep the header and footer of the previous pages,
        - through the attribut `pageset="old"` (see Example 3 &amp; 4 &amp; wiki)
    - `` (CF Example 3 &amp; wiki)
    - `` (CF Example 3 &amp; wiki)
    - `` (CF wiki)

        - Used to force the display of a section on the same page.
        - If this section does not fit into the rest of the page, a page break is done before.
    - `` (CF Examples 0 &amp; 9 &amp; wiki)

        - Can insert barcodes in pdfs, CF Examples 0 and 9
        - the possible types of codebar are alls of TCPDF
    - `` (CF Example 13 &amp; wiki)

        - can insert QRcode 2D barcodes
        - (QR Code is registered trademark of DENSO WAVE INCORPORATED | )
    - `` (CF Examples 7 &amp; About &amp; wiki)

        - Can insert bookmark in pdfs, CF Example 7 and About.
        - It is also possible to automatically create an index at the end of document (CF Example About &amp; wiki)
    - css property `rotate`:

        - Values : 0, 90, 180, 270
        - Works only on div (cf example 8)

Change log:
-----------

[](#change-log)

See on this page:

Help &amp; Support:
-------------------

[](#help--support)

For questions and bug reports, please use the GitHub issues page. You may also find some help of the official forum (link below).

Information:
------------

[](#information)

- Programmer: Spipu
- Web Site :
- Wiki :
- Support :

License:
--------

[](#license)

```
 This program is distributed under the LGPL License,
 for more information see the LICENSE file or go to
 http://www.gnu.org/licenses/lgpl.html

 Copyright 2008-2016 by Laurent Minguet

```

Thanks:
-------

[](#thanks)

- Olivier Plathey: for have made FPDF
- Nicola Asuni: for the changes he has agreed to make to TCPDF
- yAronet: for hosting support forum
- Everyone who helped me to develop this library and to bring the texts

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~26 days

Recently: every ~19 days

Total

7

Last Release

3649d ago

PHP version history (2 changes)v4.4.0PHP &gt;=5.2

v4.5.0PHP &gt;=5.3.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/43151a9b004739284e3c1ace1856cbb719578aa1f06b0e28de0f9f116a2ed1ed?d=identicon)[ilovegits](/maintainers/ilovegits)

---

Top Contributors

[![spipu](https://avatars.githubusercontent.com/u/10595905?v=4)](https://github.com/spipu "spipu (56 commits)")[![juchi](https://avatars.githubusercontent.com/u/3333098?v=4)](https://github.com/juchi "juchi (50 commits)")[![fagundes](https://avatars.githubusercontent.com/u/169477?v=4)](https://github.com/fagundes "fagundes (13 commits)")[![LittleBigFox](https://avatars.githubusercontent.com/u/7079779?v=4)](https://github.com/LittleBigFox "LittleBigFox (2 commits)")[![ilovegits](https://avatars.githubusercontent.com/u/21261003?v=4)](https://github.com/ilovegits "ilovegits (1 commits)")[![94noni](https://avatars.githubusercontent.com/u/1358361?v=4)](https://github.com/94noni "94noni (1 commits)")[![locojohn](https://avatars.githubusercontent.com/u/881947?v=4)](https://github.com/locojohn "locojohn (1 commits)")[![pjona](https://avatars.githubusercontent.com/u/170732?v=4)](https://github.com/pjona "pjona (1 commits)")[![RubenHarms](https://avatars.githubusercontent.com/u/8577820?v=4)](https://github.com/RubenHarms "RubenHarms (1 commits)")[![ixmon](https://avatars.githubusercontent.com/u/6829763?v=4)](https://github.com/ixmon "ixmon (1 commits)")[![acoquoin](https://avatars.githubusercontent.com/u/990484?v=4)](https://github.com/acoquoin "acoquoin (1 commits)")[![goulvench](https://avatars.githubusercontent.com/u/419086?v=4)](https://github.com/goulvench "goulvench (1 commits)")[![Grummfy](https://avatars.githubusercontent.com/u/668804?v=4)](https://github.com/Grummfy "Grummfy (1 commits)")

---

Tags

pdfhtmlhtml2pdf

### Embed Badge

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

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

###  Alternatives

[spipu/html2pdf

Html2Pdf is a HTML to PDF converter written in PHP - It uses TCPDF - OFFICIAL PACKAGE

1.8k10.6M45](/packages/spipu-html2pdf)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3685.2M19](/packages/gotenberg-gotenberg-php)[spiritix/php-chrome-html2pdf

A PHP library for converting HTML to PDF using Google Chrome

153472.0k3](/packages/spiritix-php-chrome-html2pdf)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[kartik-v/yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.

1605.5M84](/packages/kartik-v-yii2-mpdf)[kartik-v/yii2-export

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

1623.1M35](/packages/kartik-v-yii2-export)

PHPackages © 2026

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