PHPackages                             akyos/mpdf-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. akyos/mpdf-bundle

ActiveSymfony-bundle

akyos/mpdf-bundle
=================

A wrapper for mPDF class which allows to use mPDF in Symfony2 projects

07PHP

Since Mar 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/akyoscommunication/mpdf-bundle)[ Packagist](https://packagist.org/packages/akyos/mpdf-bundle)[ RSS](/packages/akyos-mpdf-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Installation
============

[](#installation)

### Using Composer (Symfony 2.x, Symfony 3.0.x)

[](#using-composer-symfony-2x-symfony-30x)

- Run a command

```
composer require akyos/mpdf-bundle

```

- Add a new line to `app/AppKernel.php`:

```
$bundles = [
  ...
  new Akyos\MpdfBundle\AkyosMpdfBundle(),
]

```

### Using deps-file (Symfony 2.0.x)

[](#using-deps-file-symfony-20x)

- Add a new entry to your `deps` file:

```
[AkyosMpdfBundle]
    git=https://github.com/akyoscommunication/mpdf-bundle.git
    target=/bundles/Akyos/MpdfBundle

```

- Add a new line to `app/AppKernel.php`:

```
new Akyos\MpdfBundle\AkyosMpdfBundle(),

```

- Add a new line to `app/autoload.php`:

```
'Akyos' => __DIR__.'/../vendor/bundles',

```

- Run a command

```
php bin/vendors install

```

A Quick Start guide
===================

[](#a-quick-start-guide)

### How to create a Response object

[](#how-to-create-a-response-object)

This small example creates a PDF document with format A4 and portrait orientation:

```
public function indexAction()
{
   return new \Akyos\MpdfBundle\Response\PDFResponse($this->getMpdfService()->generatePdf('Hello World'));
}

/**
 * @return \Akyos\MpdfBundle\Service\PDFService
 */
private function getMpdfService()
{
  return $this->get('akyos_mpdf.pdf');
}

```

### Generate a variable with PDF content

[](#generate-a-variable-with-pdf-content)

Sometimes it is necessary to get a variable which content is PDF document.

```
$myVar = $this->getMpdfService()->generatePdf('Hello World');

```

### How to get an instance of \\mPDF class

[](#how-to-get-an-instance-of-mpdf-class)

If you would like to work with mPDF class itself, you can use a getMpdf method:

```
$mpdf = new \Mpdf\Mpdf();
```

Additional options
==================

[](#additional-options)

Additional options might be passed via the second argument:

```
public function indexAction()
{
    return new \Akyos\MpdfBundle\Response\PDFResponse($this->getMpdfService()->generatePdf('Hello World', [
            'format' => 'A4-L' // A4 page, landscape orientation
    ]));
}

```

Detailed description is available on official manual page:

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0712a2a59177f1f0b0e6be094ae8db913fcde12ed95915eb8b89992f66afade8?d=identicon)[AkyosDev](/maintainers/AkyosDev)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/akyos-mpdf-bundle/health.svg)

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

PHPackages © 2026

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