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

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

carlescliment/html2pdf-bundle
=============================

Integrates the html2pdf REST service in Symfony 2

0.0.4(10y ago)1575GPL-2.0PHPPHP &gt;5.3.2

Since Oct 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/carlescliment/Html2PdfServiceBundle)[ Packagist](https://packagist.org/packages/carlescliment/html2pdf-bundle)[ RSS](/packages/carlescliment-html2pdf-bundle/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Html2PdfServiceBundle
=====================

[](#html2pdfservicebundle)

[![Build Status](https://camo.githubusercontent.com/31a053f496986a58d77672fa5f4b782e5882627e3582d3ed58278624e380f191/68747470733a2f2f7472617669732d63692e6f72672f6361726c6573636c696d656e742f48746d6c325064665365727669636542756e646c652e706e67)](https://travis-ci.org/carlescliment/Html2PdfServiceBundle)

This is a Symfony 2 client for the [Html2Pdf REST Service](https://github.com/carlescliment/html2pdf-service).

Installation
------------

[](#installation)

Include the bundle in your composer.json file.

```
    "require": {
        ...
        "carlescliment/html2pdf-bundle": "dev-master"
    }

```

Modify your AppKernel:

```
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new carlescliment\Html2PdfServiceBundle\carlesclimentHtml2PdfServiceBundle(),
        );
```

Set the bundle configuration in your `config.yml`:

```
parameters:
    html2pdf.host: http://html2pdf.mydomain.com
    html2pdf.port: 80
```

Execute `php composer.phar update carlescliment/html2pdf-bundle`

Usage
-----

[](#usage)

From your controller, render the template and pass it to the service:

```
class SampleController extends Controller
{
    public function toPdfAction()
    {
        $view = $this->renderView('YourBundle:Sample:toPdf.html.twig');
        $bridge = $this->get('html2pdf.bridge');
        $options = array('footer-left' => 'my footer');
        return $bridge->getFromHtml($view, 'document_name', $options);
    }
}
```

Testing
-------

[](#testing)

Execute phpunit in the bundle's root dir to run the tests.

If you need functional or integration tests and don't want to make real curl requests, you can use the NullProtocol in order to disable them. Put this configuration in your config\_test.yml file.

```
html2pdf.protocol:
    class: carlescliment\Html2PdfServiceBundle\Protocol\NullProtocol

```

TO-DO
-----

[](#to-do)

- Port setting is currently being ignored

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~352 days

Total

3

Last Release

3884d ago

### Community

Maintainers

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

---

Top Contributors

[![carlescliment](https://avatars.githubusercontent.com/u/1255401?v=4)](https://github.com/carlescliment "carlescliment (52 commits)")

---

Tags

pdfhtmlconversion

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)[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)[spiritix/php-chrome-html2pdf

A PHP library for converting HTML to PDF using Google Chrome

153472.0k3](/packages/spiritix-php-chrome-html2pdf)[danielboendergaard/phantom-pdf

A Package for generating PDF files using PhantomJS

72467.9k](/packages/danielboendergaard-phantom-pdf)

PHPackages © 2026

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