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

ActiveSymfony-bundle[PDF &amp; Document Generation](/categories/documents)

ensepar/html2pdf-bundle
=======================

Use HTML2PDF as a Symfony Service

v5.0.0(1y ago)27669.3k—0.5%25MITPHPPHP &gt;=7.2.5

Since Jun 13Pushed 1y ago4 watchersCompare

[ Source](https://github.com/FrDeamon/EnseparHtml2pdfBundle)[ Packagist](https://packagist.org/packages/ensepar/html2pdf-bundle)[ Docs](https://github.com/FrDeamon/EnseparHtml2pdfBundle)[ RSS](/packages/ensepar-html2pdf-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (16)Used By (0)

EnseparHtml2pdfBundle
=====================

[](#enseparhtml2pdfbundle)

[![Build Status](https://camo.githubusercontent.com/1ae205048742c2cb15f19d9473a790e15e7d8b95e748b4788820e9e0c101ff62/68747470733a2f2f7472617669732d63692e6f72672f46724465616d6f6e2f456e736570617248746d6c3270646642756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/FrDeamon/EnseparHtml2pdfBundle)

[Html2pdf](https://github.com/spipu/html2pdf) for Symfony as a service.

How to install?
---------------

[](#how-to-install)

Just add this to your composer.json file:

```
"require": {
  ...
  "ensepar/html2pdf-bundle" : "^5.0"
}
```

or via composer:

```
$ composer require ensepar/html2pdf-bundle
```

Enable it in bundles if not already

```
Ensepar\Html2pdfBundle\EnseparHtml2pdfBundle::class => ['all' => true],
```

How to use?
-----------

[](#how-to-use)

Via dependency injection:

```
class Html2Pdf
{
    /**
     * @Route("/create")
     */
    public function create(Html2pdfFactory $html2pdfFactory)
    {

        $html2pdf = $html2pdfFactory->create();
    }
}
```

Via the container:

```
$html2pdf = $this->get('html2pdf_factory')->create();
```

You can pass every option you would pass to html2pdf, for instance :

```
$html2pdf = $this->get('html2pdf_factory')->create('P', 'A4', 'en', true, 'UTF-8', [10, 15, 10, 15]);
```

If the previous arguments are not provided, the factory uses its own default values.
You can change those default values by adding the bundle configuration to your config file:

```
ensepar_html2pdf:
    orientation: 'P'
    format: 'A4'
    lang: 'en'
    unicode: true
    encoding: 'UTF-8'
    margin: [10, 15, 10, 15]
```

Read more on the library `Html2pdf` [here](https://github.com/spipu/html2pdf/blob/master/doc/README.md).

How to run the tests?
---------------------

[](#how-to-run-the-tests)

```
$ composer install
$ php vendor/bin/phpunit
```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance41

Moderate activity, may be stable

Popularity49

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

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

Every ~302 days

Recently: every ~509 days

Total

15

Last Release

496d ago

Major Versions

1.0.2 → v2.0.02014-10-25

v2.0.0 → v3.0.0-beta2016-01-02

2.0.x-dev → v4.0.02018-09-24

v4.1.0 → v5.0.0-rc12022-01-03

PHP version history (3 changes)1.0.0PHP &gt;=5.3.2

v4.0.0PHP &gt;=5.4

v5.0.0-rc1PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/95352e0b7023eef954a0902948970e3d5824f7637f544582e99f7bf381f66fac?d=identicon)[tmaindron](/maintainers/tmaindron)

![](https://www.gravatar.com/avatar/bac0cbed6d7ad2d35441b94fa670ab53396d0f93d5cd24e9d45206e752d222fa?d=identicon)[Deamon](/maintainers/Deamon)

---

Top Contributors

[![OwlyCode](https://avatars.githubusercontent.com/u/1631270?v=4)](https://github.com/OwlyCode "OwlyCode (29 commits)")[![Deamon](https://avatars.githubusercontent.com/u/560209?v=4)](https://github.com/Deamon "Deamon (5 commits)")[![EricGrivilers](https://avatars.githubusercontent.com/u/2196100?v=4)](https://github.com/EricGrivilers "EricGrivilers (2 commits)")[![kl3sk](https://avatars.githubusercontent.com/u/2953145?v=4)](https://github.com/kl3sk "kl3sk (2 commits)")[![94noni](https://avatars.githubusercontent.com/u/1358361?v=4)](https://github.com/94noni "94noni (1 commits)")[![Taluu](https://avatars.githubusercontent.com/u/239685?v=4)](https://github.com/Taluu "Taluu (1 commits)")[![JeremYzalis](https://avatars.githubusercontent.com/u/1381381?v=4)](https://github.com/JeremYzalis "JeremYzalis (1 commits)")[![LeJeanbono](https://avatars.githubusercontent.com/u/11347342?v=4)](https://github.com/LeJeanbono "LeJeanbono (1 commits)")[![Sevrahk](https://avatars.githubusercontent.com/u/3979553?v=4)](https://github.com/Sevrahk "Sevrahk (1 commits)")

---

Tags

symfonybundlepdfTCPDFhtml2pdf

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)[nucleos/dompdf-bundle

This bundle provides a wrapper for using dompdf inside symfony.

54882.8k1](/packages/nucleos-dompdf-bundle)[pontedilana/weasyprint-bundle

Easily create PDF in Symfony by converting Twig/HTML templates.

40774.4k](/packages/pontedilana-weasyprint-bundle)[padam87/rasterize-bundle

HTML to PDF Symfony bundle. Works with Puppeteer, PhantomJS, and more.

1579.4k](/packages/padam87-rasterize-bundle)[onurb/excel-bundle

Symfony Bundle to read or write Excel file (including pdf, xlsx, odt), using phpoffice/phpspreadsheet library (replacement of phpoffice/phpexcel, abandonned)

15332.0k](/packages/onurb-excel-bundle)[bobv/latex-bundle

Latex and pdf generator for Symfony 2

2432.7k](/packages/bobv-latex-bundle)

PHPackages © 2026

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