# mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

Repository: https://github.com/mpdf/mpdf
Canonical: https://ross.abutalabs.com/products/mpdf
Homepage: https://mpdf.github.io
Language: PHP
License: GPL-2.0
License Family: copyleft
Topics: php, pdf, html, utf-8, cjk, css
Last push: 2026-06-11T13:03:42+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 87, release rhythm 8, longevity 100
- inputs: {"age_days": 4201, "days_push": 83, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4700, forks 1110 (observed 2026-08-28T04:08:57.171821+00:00)

## What it is
mPDF is a PHP library that generates PDF documents from UTF-8 encoded HTML, based on FPDF and HTML2FPDF with extensive enhancements. It supports CSS styling, CJK and other Unicode scripts, barcodes, headers/footers, page numbering, and tables of contents.

## Use cases
- generate pdf invoices from html templates in php
- convert utf-8 html to pdf with cjk font support
- create pdf documents with headers footers and page numbers in php
- generate pdfs with barcodes and table of contents
- produce printable pdf reports from a php web app

## When to choose
- you need pure-PHP PDF generation without external binaries
- you need Unicode/CJK text, barcodes, TOCs, or page numbering
- you control the HTML/CSS templates and can tailor them for mPDF

## When to avoid
- you need state-of-the-art CSS support or pixel-perfect mirroring of existing web pages (use headless Chrome)
- you plan to pass unsanitized user-supplied HTML/CSS directly into the library
- you need a modern, actively evolving CSS engine

## Facets
- artifact type: library
- maturity: maintenance
- function: pdf, templating
- domain: pdf, web-development, files
- platform: php, cli
- tags: html-to-pdf, utf-8, cjk, css, composer, fpdf, web-server

## Member repositories
- mpdf/mpdf (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:57.171821+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:13.477605+00:00, confidence not recorded.
  - readme: https://github.com/mpdf/mpdf (fetched 2026-08-28T04:08:57.171821+00:00, sha 18fd88b5450a)
  - homepage: https://mpdf.github.io (fetched 2026-08-29T09:03:05.995418+00:00, sha 1e3c3d767c08)
- Data as of 2026-08-30T08:39:29.467469+00:00.
