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

ActiveSymfony-bundle

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 1mo 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 54% 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

2600d 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://www.gravatar.com/avatar/a90cdbc9d7786cf264707be1608978e93006fccb8ed6ff06ceec1ea5d2680bf7?d=identicon)[hanishsingla](/maintainers/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

[stfalcon/tinymce-bundle

This Bundle integrates TinyMCE WYSIWYG editor into a Symfony2 project.

2692.9M24](/packages/stfalcon-tinymce-bundle)[fsi/admin-bundle

FSi Admin Bundle. Admin generator for Symfony.

5849.2k7](/packages/fsi-admin-bundle)[nucleos/dompdf-bundle

This bundle provides a wrapper for using dompdf inside symfony.

54882.8k1](/packages/nucleos-dompdf-bundle)

PHPackages © 2026

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