mPDF Manual
– mPDF Variables
About mPDF
Features
Requirements
Requirements < v7.0
Limitations
Credits
Changelog
License
Installation & Setup
Installation v7.x+
Using mPDF without Composer
Reducing memory usage
Folders for temporary files
Logging
Installation v6.x
Getting Started
Creating your first file
HTML or PHP?
Fonts & Languages
Fonts in mPDF 7.x
Fonts in mPDF 6.x
Fonts in mPDF 5.x
About PDF files
OpenType layout (OTL)
Font names
Available Fonts v6 and v7
Available Fonts v5.x
Choosing a configuration v7.x
Choosing a configuration v6.x
Choosing a configuration v5.x
Automatic font selection
lang 6.x
lang v5.x
Input encoding
Bidirectional (RTL) text v6.x
Arabic (RTL) text v5.x
CJK Languages
Default Font
Font substitution 7.x
Font substitution 6.x
Font substitution 5.x
Character substitution
Fonts & Language cover v5.x
Indic fonts v5.x
Configuration
Configuration v7.x
Configuration files v6.x
Configuration Methods
Configuration Variables
HTML support
HTML Tags
HTML Attributes
Custom HTML Tags
Tables
Tables
Table layout
Auto-layout algorithm
Border collapse
Paging
Page breaks
Double-sided documents
Page size & Orientation
Page numbering
Using @page
Different page sizes
Headers & Footers
Headers & Footers
Method 1 - Runtime Non-HTML
Method 2 - Runtime HTML
Method 3 - Named Non-HTML
Method 4 - Named HTML
Page numbers & Date
Headers & Top margins
Browser compatible HTML
Rotated pages
CSS & Stylesheets
Introduction
Supported CSS
Default stylesheet
Named colours
Setting PDF file properties
Password protection
Document Metadata
PDF Version
What Else Can I Do
Backgrounds & Borders
Fixed position blocks
Floating blocks
Hyphenation
Images
Kerning
Line-height
Line breaking
Lists
Text Justification
Annotations
Barcodes
Bookmarks
Columns
Forms
Index
Layers
Table of Contents
Watermarks
Replaceable Aliases
CMYK colours
Importing files & Templates
Overwriting existing files
Writing non-HTML text
PDF/A-3 associated files + additional xmp rdf
PDF/A1-b compliance
PDF/X-1a compliance
Capture HTML output
Math Formulae with MathJax
Math with MathJax 2
Combining Diacritics
Real life examples
Overview
PDF from every page of website
Colour Charts CMYK
E-mail a PDF file
A5 Booklet
Letterhead letters
User Input
Write directly to document
Direct writing to document
Troubleshooting
Known Issues
Slow!
Browser output as strange characters
Text is replaced
Reserved Terms
Browser incompatability
Error messages
Blank screen
Corrupt PDF file
Notice warnings
Image errors
Memory problems
Resizing
mPDF class fails to Initialise
Postcript printers
Incompatible PHP version
Reference
mPDF functions
Overview
__construct()
AddColumn()
AddFontDirectory()
AddPage()
AddPageByArray()
AddSpotColor
AliasNbPages()
AliasNbPageGroups()
Annotation()
AutosizeText()
Bookmark()
CircularText()
CreateIndex()
CreateReference()
DefFooterByName()
DefHeaderByName()
DefHTMLFooterByName()
DefHTMLHeaderByName()
Image()
ImportPage() (until 8.0)
importPage() (since 8.0)
IndexEntry()
IndexEntrySee()
InsertIndex()
MultiCell()
Output()
OutputBinaryData()
OutputFile()
OutputHttpDownload()
OutputHttpInline()
OverWrite()
RestartDocTemplate()
RestrictUnicodeFonts()
RoundedRect()
SetAlpha()
SetAnchor2Bookmark()
SetAuthor()
SetAutoFont()
SetBasePath()
SetColumns()
SetCompression()
SetCreator()
SetDefaultBodyCSS()
SetDefaultFont()
SetDefaultFontSize()
SetDirectionality()
SetDisplayMode()
SetDisplayPreferences()
SetDocTemplate()
SetFooter()
SetFooterByName()
SetHeader()
SetHeaderByName()
SetHTMLFooter()
SetHTMLFooterByName()
SetHTMLHeader()
SetHTMLHeaderByName()
SetImportUse()
SetKeywords()
setLogger()
SetPageTemplate()
SetProtection()
SetSourceFile() (until 8.0)
setSourceFile() (since 8.0)
SetSubject()
SetTitle()
SetVisibility()
SetWatermarkImage()
SetWatermarkText()
Shaded_box()
StartProgressBarOutput()
Thumbnail()
TOCpagebreak()
TOCpagebreakByArray()
TOC_Entry()
UseTemplate() (until 8.0)
useTemplate() (since 8.0)
WriteBarcode()
WriteCell()
WriteFixedPosHTML()
WriteHTML()
WriteText()
FPDF Original Functions
HTML control tags
Overview
annotation
barcode
bookmark
columnbreak
columns
dottab
formfeed
htmlpagefooter
htmlpageheader
indexentry
indexinsert
pagebreak
pageheader
pagefooter
sethtmlpagefooter
sethtmlpageheader
setpagefooter
setpageheader
textcircle
tocentry
tocpagebreak
watermarkimage
watermarktext
mPDF Variables
Overview
adjustFontDescLineheight
aliasNbPg
aliasNbPgGp
allow_charset_conversion
allow_html_optional_endtags
allow_output_buffering
allowCJKorphans
allowCJKoverflow
anchor2Bookmark
annotMargin
annotOpacity
autoArabic
autoFontGroupSize
autoLangToFont
autoMarginPadding
autoPageBreak
autoScriptToLang
autoVietnamese
backupSubsFont
backupSIPFont
baseScript
biDirectional
bleedMargin
bookmarkStyles
charset_in
CJKforceend
collapseBlockMargins
cropMarkLength
cropMarkMargin
crossMarkMargin
curlAllowUnsafeSslRequests
curlTimeout
curlFollowLocation
CSSselectMedia
decimal_align
debug
debugfonts
defaultfooterfontsize
defaultfooterfontstyle
defaultfooterline
defaultheaderfontsize
defaultheaderfontstyle
defaultheaderline
displayDefaultOrientation
defaultPageNumStyle
dpi
enableImports
exposeVersion
falseBoldWeight
footer_line_spacing
fontdata
forcePortraitHeaders
forcePortraitMargins
header_line_spacing
h2bookmarks
h2toc
ICCProfile
ignore_invalid_utf8
ignore_table_percents
ignore_table_widths
img_dpi
incrementFPR1 [1-4]
iterationCounter
jSmaxChar
jSmaxCharLast
jSmaxWordLast
jSWord
justifyB4br
keepColumns
keep_table_proportions
list_align_style
list_auto_mode
list_indent_default
list_indent_default_mpdf
list_indent_first_level
list_marker_offset
list_number_suffix
list_symbol_size
margBuffer
max_colH_correction
maxTTFFilesize
mirrorMargins
nbpgPrefix
nbpgSuffix
nonPrintMargin
normalLineheight
packTableData
pagenumPrefix
pagenumSuffix
PDFA
PDFAauto
PDFX
PDFXauto
percentSubset
printers_info
progbar_altHTML
progbar_heading
progressBar
repackageTTF
restoreBlockPagebreaks
restrictColorSpace
setAutoBottomMargin
setAutoTopMargin
showImageErrors
showStats
showWatermarkImage
showWatermarkText
shrink_tables_to_fit
SHYlang
simpleTables
smCapsScale
smCapsStretch
table_error_report
table_error_report_param
tableMinSizePriority
tabSpaces
text_input_as_HTML
title2annots
use_kwt
useAdobeCJK
useDictionaryLBR
useFixedNormalLineHeight
useFixedTextBaseline
useGraphs
useKerning
useLang
useSubstitutions
useTibetanLBR
watermark_font
watermarkAngle
watermarkImageAlpha
watermarkImgAlphaBlend
watermarkImgBehind
watermarkTextAlpha
mPDF Utilities
strcode2utf()
preparePreText()
Codepages & Glyphs
Win-1252
ASCII characters
Win-1251
ISO-8859-2
ISO-8859-4
ISO-8859-7
ISO-8859-9
ISO-8859/win comparison chart
ZapfDingbats (Adobe)
Symbols (Adobe)
Vietnamese
BIG-5 (Traditional Chinese)
HKCS (Hong Kong Character Set)
GBK (Simplified Chinese)
SHIFT_JIS (Japanese)
UHC (Korean)
Demo - Pangrams
Demo - Other languages
Demo - 1000 Character Classic
Demo - Other Unicode character
Equivalent codepages
iconv
mbstring
Unicode character planes
ISO 639-1 language codes
Useful links
Unicode coverage of Free Fonts
PDF Files (Adobe)
PDF reference
table_error_report_param