mPDF topic index
Find the mPDF function, setting, tag or placeholder you need, and jump to the guide that explains it with examples. The guides cover mPDF 8. If you followed a link to an old version 5 or 6 manual page, the matching topic below explains how the same thing works today.
A
AddPage() | Start a new page from PHP |
autoLangToFont | Choose fonts per language |
autoScriptToLang | Detect scripts in mixed text |
B
background-image-resize | Scale background images |
<barcode> | Barcodes and QR codes |
bcmath extension | Needed by some barcode types |
border-radius | Rounded corners |
C
<columns> | Multi-column text |
Composer install | composer require mpdf/mpdf |
CSS support | What the CSS engine handles |
D
{DATE} | Date placeholder |
default_font | Font used when none is set |
Destination::DOWNLOAD | Force a download |
Destination::STRING_RETURN | Get the PDF as a string |
dir="rtl" | Right-to-left text |
E
Email attachment | PHPMailer and Symfony Mailer |
F
Flexbox and grid | Not supported: alternatives |
fontDir and fontdata | Add your own fonts |
format | Paper size |
Form input to PDF | Validate and escape user input |
H
<htmlpagefooter> | Named footers |
<htmlpageheader> | Named headers |
HTML tags | Supported elements |
I
imageVars | Images from memory |
img_dpi | Default image resolution |
Invoice template | Complete example |
L
lang attribute | Mark the language of text |
linear-gradient() | Gradient backgrounds |
M
margin_top / margin_bottom | Page margins |
memory_limit | Memory errors |
mode | utf-8 or core fonts |
N
{nbpg} | Total pages |
O
Output() | Show, download, save or return |
P
packTableData | Big tables in less memory |
<pagebreak> | Page breaks and orientation changes |
page-break-inside | Keep tables together |
{PAGENO} | Page number placeholder |
PDFA | Archival PDF/A output |
R
Requirements | PHP version and extensions |
resetpagenum | Restart page numbering |
S
SetAuthor() | Document author |
SetDirectionality() | Right-to-left documents |
SetFooter() | Simple three-part footer |
SetHTMLFooter() | HTML footers |
SetHTMLHeader() | HTML headers |
SetProtection() | Passwords and permissions |
SetTitle() | Document title |
showImageErrors | Debug missing images |
shrink_tables_to_fit | Wide tables |
simpleTables | Faster large tables |
SVG | Vector images |
T
tempDir | Writable cache folder |
U
useActiveForms | Fillable form fields |
use_kwt | Keep headings with tables |
W
WriteHTML() | Writing in chunks |
For the complete reference of every option, see the official documentation at mpdf.github.io.