PHPackages                             symfgenus/mpdf-wrapper - 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. symfgenus/mpdf-wrapper

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

symfgenus/mpdf-wrapper
======================

This bundle allows to use mpdf library with symfony3.

3.0(7y ago)151MITPHPPHP &gt;=7.0

Since Mar 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/hanishsingla/mpdf-wrapper)[ Packagist](https://packagist.org/packages/symfgenus/mpdf-wrapper)[ Docs](https://github.com/hanishsingla/mpdf-wrapper)[ RSS](/packages/symfgenus-mpdf-wrapper/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

mpdf-wrapper
============

[](#mpdf-wrapper)

This bundle provides a service for mpdf library with symfony 4.

1 Installation
---------------------------------------------

[](#1-installation)

### 1.1 Download MpdfWrapperBundle using composer

[](#11-download-mpdfwrapperbundle-using-composer)

Run in terminal:

```
$ php composer.phar require symfgenus/mpdf-wrapper
```

### 1.2 Enable the bundle

[](#12-enable-the-bundle)

Symfony flex activates the bundles automatically. If it is not, then enable the bundle:

```
// /config/bundles.php

    [
        // ...
        Symfgenus\MpdfWrapper\MpdfWrapperBundle::class => ['all' => true],
    ];
```

2 Usage
--------------------------------------

[](#2-usage)

MpdfService provides many ways to use MPDF.

### 2.1 It can generate a direct pdf response which can be served through any route.

[](#21-it-can-generate-a-direct-pdf-response-which-can-be-served-through-any-route)

```
// /config/bundles.php

    public function index(MpdfService $MpdfService)
    {
        return $MpdfService->generatePdfResponse($pdfHtml);
    }
```

### 2.2 It can also generate pdf content which can be saved in a variable and used.

[](#22-it-can-also-generate-pdf-content-which-can-be-saved-in-a-variable-and-used)

```
// /config/bundles.php

    public function index(MpdfService $MpdfService)
    {
        return $pdf = $MpdfService->generatePdf($pdfHtml);
    }
```

### 2.3 Sometimes there is need to create multiple PDFs, MpdfService can be used as following:

[](#23-sometimes-there-is-need-to-create-multiple-pdfs-mpdfservice-can-be-used-as-following)

```
// /config/bundles.php

    public function index(MpdfService $MpdfService)
    {
        $firstPdf = $MpdfService->getMpdf($argsFirst);
        $mpdf->WriteHTML($htmlFirst);
        $firstPdfFile = $mpdf->Output();

        $secondPdf = $MpdfService->getMpdf($argsSecond);
        $mpdf->WriteHTML($htmlSecond);
        $secondPdfFile = $mpdf->Output();

        return [
            $firstPdfFile,
            $secondPdfFile
        ];
    }
```

3 Usage for symfony 3
----------------------------------------------------

[](#3-usage-for-symfony-3)

For symfony 3, this service can be loaded as following:

```
$this->get('symfgenus.mpdf.wrapper').
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~243 days

Total

4

Last Release

2651d ago

Major Versions

1.0.1 → 2.02018-02-09

2.0 → 3.02019-03-27

PHP version history (2 changes)1.0.0PHP &gt;=5.5.9

3.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10900615?v=4)[Hanish Singla](/maintainers/hanishsingla)[@hanishsingla](https://github.com/hanishsingla)

---

Top Contributors

[![hanish-singla](https://avatars.githubusercontent.com/u/6129169?v=4)](https://github.com/hanish-singla "hanish-singla (11 commits)")[![hanishsingla](https://avatars.githubusercontent.com/u/10900615?v=4)](https://github.com/hanishsingla "hanishsingla (11 commits)")

---

Tags

mpdfsymfonysymfony-bundlesymfony2symfony3wrapperbundleSymfony2wrappermpdfsymfony3

### Embed Badge

![Health badge](/badges/symfgenus-mpdf-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/symfgenus-mpdf-wrapper/health.svg)](https://phpackages.com/packages/symfgenus-mpdf-wrapper)
```

###  Alternatives

[liuggio/excelbundle

This is a Symfony2 Bundle helps you to read and write Excel files (including pdf, xlsx, odt), thanks to the PHPExcel library

3706.4M11](/packages/liuggio-excelbundle)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[nucleos/dompdf-bundle

This bundle provides a wrapper for using dompdf inside symfony.

55977.7k1](/packages/nucleos-dompdf-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

65474.5k9](/packages/web-auth-webauthn-symfony-bundle)

PHPackages © 2026

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