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

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

kartik-v/mpdf
=============

A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support. This is a fork of the official mPDF library.

v1.0.2(11y ago)39328.4k—5.6%55[5 issues](https://github.com/kartik-v/mpdf/issues)[2 PRs](https://github.com/kartik-v/mpdf/pulls)1GPL-1.0+PHPPHP &gt;=4.3.10

Since Nov 8Pushed 7y ago2 watchersCompare

[ Source](https://github.com/kartik-v/mpdf)[ Packagist](https://packagist.org/packages/kartik-v/mpdf)[ Docs](http://www.mpdf1.com/mpdf/index.php)[ RSS](/packages/kartik-v-mpdf/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (5)Used By (1)

mpdf
====

[](#mpdf)

[![Latest Stable Version](https://camo.githubusercontent.com/a959fcda308fb714c66f0857f825106a1a357122fcc7cebf31634323cb4e5804/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f6d7064662f762f737461626c65)](https://packagist.org/packages/kartik-v/mpdf)[![License](https://camo.githubusercontent.com/1230b5ae7ea2a543bbf708fd216f12cba740003ad4cafc19306ba0cf35910b6d/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f6d7064662f6c6963656e7365)](https://packagist.org/packages/kartik-v/mpdf)[![Total Downloads](https://camo.githubusercontent.com/aa3f88362af181fe95dc861424d283afd09ce9ca6c0910235fd7a6ad6cf1fe07/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f6d7064662f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/mpdf)[![Monthly Downloads](https://camo.githubusercontent.com/37146df02b711f0ffc790bb84561491305351dddb77deb3cb632b8dabfff2d96/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f6d7064662f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/mpdf)[![Daily Downloads](https://camo.githubusercontent.com/61d814d9b90333cac330acd4cccf773695b6a5fd51af36a2e25621df603636a3/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f6d7064662f642f6461696c79)](https://packagist.org/packages/kartik-v/mpdf)

---

### Use the [mpdf/mpdf](https://github.com/mpdf/mpdf) repo instead

[](#use-the-mpdfmpdf-repo-instead)

> Effective 08-Apr-2016, I am redirecting and encouraging folks to use the above repo - to ensure a single codebase for mpdf management in future. This repo was initially created since there was no other package having the 6.x release that could be installed via composer. For folks coming over from Yii, note that the [yii2-mpdf extension](https://github.com/kartik-v/yii2-mpdf) has been modified to use the [mpdf/mpdf](https://github.com/mpdf/mpdf) repo

---

This is a fork of the [mPDF library](http://mpdf1.com/). 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/), with a number of enhancements. It is slower than the original scripts e.g. HTML2FPDF and produces larger files when using Unicode fonts, but support for CSS styles etc. has been much enhanced.

This fork adds composer and packagist support.

Why this repo?
--------------

[](#why-this-repo)

I needed this for building many of my dependent PHP based projects that use this wonderful PDF library. Managing package dependencies via a central repository was important for folks like me. I use composer to manage package dependencies via packages on packagist.org. This repository allows access to some specific features and needs:

1. Adds ability to update library and manage dependencies via composer in your PHP based applications
2. Uses the latest development version (v6.0beta) of the mPDF library. I needed the latest development version via composer, which was not found elsewhere. mPDF 6.0 can utilise OpenType layout tables to display complex scripts. It will be of most interest to those wishing to use Arabic or Indic scripts (as well as Khmer, Lao, Myanmar etc.). It will also improve the display of Thai, Vietnamese and Hebrew.
3. This beta release (v6.0) contains fonts (open source) to cover almost every imaginable script / language. It also includes additional fonts for Chinese, Japanese, and Korean.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require mpdf/mpdf "@dev"

```

or add

```
"mpdf/mpdf": "@dev"

```

to the `require` section of your `composer.json` file.

Refer the [readme instructions](https://github.com/mpdf/mpdf/blob/master/README.txt) for other details on setting up the extension.

Usage
-----

[](#usage)

PHP 5.4 and later can use namespaces to access. Refer the [documentation manual](https://mpdf.github.io) or the [upstream mpdf site](http://mpdf1.com) for further details and understanding of the library.

```
use \mPDF;

$pdf = new mPDF();
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 90.6% 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 ~59 days

Total

4

Last Release

4032d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (29 commits)")[![danielhjames](https://avatars.githubusercontent.com/u/1867708?v=4)](https://github.com/danielhjames "danielhjames (1 commits)")[![danik2592](https://avatars.githubusercontent.com/u/14977920?v=4)](https://github.com/danik2592 "danik2592 (1 commits)")[![iddqdidkfa](https://avatars.githubusercontent.com/u/1819727?v=4)](https://github.com/iddqdidkfa "iddqdidkfa (1 commits)")

---

Tags

phppdfutf-8

### Embed Badge

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

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

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)

PHPackages © 2026

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