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

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

kvr001/mpdf
===========

PHP library generating PDF files from UTF-8 encoded HTML

V8.99.0(4y ago)01231GPL-2.0-onlyPHPPHP ^5.6 || ^7.0 || ~8.0.0

Since Nov 20Pushed 4y agoCompare

[ Source](https://github.com/kvr001/mpdf)[ Packagist](https://packagist.org/packages/kvr001/mpdf)[ Docs](https://mpdf.github.io)[ Fund](https://www.paypal.me/mpdf)[ RSS](/packages/kvr001-mpdf/feed)WikiDiscussions development Synced today

READMEChangelog (1)Dependencies (9)Versions (58)Used By (1)

mPDF is a PHP library which generates PDF files from UTF-8 encoded HTML.

It is based on [FPDF](http://www.fpdf.org/) and [HTML2FPDF](http://html2fpdf.sourceforge.net/)(see [CREDITS](CREDITS.txt)), with a number of enhancements. mPDF was written by Ian Back and is released under the [GNU GPL v2 licence](LICENSE.txt).

[![Latest Stable Version](https://camo.githubusercontent.com/ce455006187aa6ef220405b19e11c3bf90497d2390c1a6f1c8137fd0e52449d9/68747470733a2f2f706f7365722e707567782e6f72672f6d7064662f6d7064662f762f737461626c65)](https://packagist.org/packages/mpdf/mpdf)[![Total Downloads](https://camo.githubusercontent.com/02f8c232a4d119c4f84b305d0da8a75f43796c362b7bfd2d1e4b3860b278e375/68747470733a2f2f706f7365722e707567782e6f72672f6d7064662f6d7064662f646f776e6c6f616473)](https://packagist.org/packages/mpdf/mpdf)[![License](https://camo.githubusercontent.com/4a38f2c03b8ac4cfe10de06d5f8a45294c2ae3e222de17d6c51dd1ee1fd2fb18/68747470733a2f2f706f7365722e707567782e6f72672f6d7064662f6d7064662f6c6963656e7365)](https://packagist.org/packages/mpdf/mpdf)

> ⚠ If you are viewing this file on mPDF GitHub repository homepage or on Packagist, please note that the default repository branch is `development` which can differ from the last stable release.

Requirements
============

[](#requirements)

PHP versions and extensions
---------------------------

[](#php-versions-and-extensions)

- `mPDF >=7.0` is supported on `PHP ^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0`
- `PHP 7.3` is supported since `mPDF v7.1.7`
- `PHP 7.4` is supported since `mPDF v8.0.4`
- `PHP 8.0` is supported since `mPDF v8.0.10`

PHP `mbstring` and `gd` extensions have to be loaded.

Additional extensions may be required for some advanced features such as `zlib` for compression of output and embedded resources such as fonts, `bcmath` for generating barcodes or `xml` for character set conversion and SVG handling.

Known server caveats
--------------------

[](#known-server-caveats)

mPDF has some problems with fetching external HTTP resources with single threaded servers such as `php -S`. A proper server such as nginx (php-fpm) or Apache is recommended.

Support us
==========

[](#support-us)

Consider supporting development of mPDF with a donation of any value. [Donation button](https://mpdf.github.io) can be found on the [main page of the documentation](https://mpdf.github.io).

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

[](#installation)

Official installation method is via composer and its packagist package [mpdf/mpdf](https://packagist.org/packages/mpdf/mpdf).

```
$ composer require mpdf/mpdf

```

Usage
=====

[](#usage)

The simplest usage (since version 7.0) of the library would be as follows:

```
