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

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

zloadmin/mpdf
=============

A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support

016PHP

Since Nov 8Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

mPDF is a PHP class 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).

[![Build Status](https://camo.githubusercontent.com/de0221c162edf47485883569d2a8a348f9bcd204272c99938bf84cdde7ba8c70/68747470733a2f2f7472617669732d63692e6f72672f6d7064662f6d7064662e7376673f6272616e63683d646576656c6f706d656e74)](https://travis-ci.org/mpdf/mpdf)

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

[](#installation)

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

Manual installation
-------------------

[](#manual-installation)

- Download the [.zip release file](https://github.com/mpdf/mpdf/releases) and unzip it
- Create a folder e.g. /mpdf on your server
- Upload all of the files to the server, maintaining the folders as they are
- Ensure that you have write permissions set (CHMOD 6xx or 7xx) for the following folders:

    /ttfontdata/ - used to cache font data; improves performance a lot

    /tmp/ - used for some images and ProgressBar

    /graph\_cache/ - if you are using [JpGraph](http://jpgraph.net) in conjunction with mPDF

To test the installation, point your browser to the basic example file:

```
[path_to_mpdf_folder]/mpdf/examples/example01_basic.php

```

If you wish to define a different folder for temporary files rather than /tmp/ see the note on [Folder for temporary files](https://mpdf.github.io/installation-setup/folders-for-temporary-files.html)in the section on Installation &amp; Setup in the [manual](https://mpdf.github.io/).

If you have problems, please read the section on [troubleshooting](https://mpdf.github.io/troubleshooting/known-issues.html) in the manual.

Online manual
=============

[](#online-manual)

Online manual is available at .

Unit Testing
============

[](#unit-testing)

Unit testing for mPDF is done using [PHPUnit](https://phpunit.de/).

To get started, run `composer install` from the command line while in the mPDF root directory (you'll need [composer installed first](https://getcomposer.org/download/)).

To execute tests, run `vendor/bin/phpunit` from the command line while in the mPDF root directory.

Any assistance writing unit tests for mPDF is greatly appreciated. If you'd like to help, please note that any PHP file located in the `/tests/` directory will be autoloaded when unit testing.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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/194b91254dde8eb167b5edccc4e860dc8de9e59db8e5cecec7250ddd38651825?d=identicon)[zloadmin](/maintainers/zloadmin)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.2k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M100](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M128](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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