mPDF Manual – Installation & Setup

Installation v5.x

First-time users

Installation:

  • Download the .zip file 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 for the following folders:
    • /ttfontdata/
    • /tmp/
    • /graph_cache/

To test the installation, point your browser to the example files folder e.g. [path_to_mpdf_folder]/mpdf/examples/

If you wish to install additional fonts please see the notes in Fonts & Languages for further instructions.

If you wish to define a different folder for temporary files rather than /tmp/ see the note on ‘Folder for temporary files’.

If you have problems, please read the section on troubleshooting in the manual.

Upgrading from version mPDF 5.0 Beta

There is no upgrade package from v5 beta because so many of the files have had at least minor changes. You can overwrite most of the files, taking care to keep a note of your 3 configuration files.

Important: You must delete all temporary files in the /ttfontdata/ folder.

Changes from 5.0 Beta

  • config.php file has been changed (extra CJK characters to recognise CJK blocks)
  • `$this->backupSubsFont` (in config_fonts.php) optionally now takes an array
  • no need to define `'cjk'=>true` or `'sip|smp'=>true` in config_fonts.php (ignored; cf. `$this->BMPonly`)
  • Indic language fonts have been altered to add Latin and Latin-1 Supplement characters
  • progress bars now has an external progbar.css and configurable main heading
  • added initial parameter `new mPDF('+aCJK')` or `'-aCJK'` to override default useAdobeCJK at runtime
  • QRCode is not included in main download (but as an extra package)

Earlier versions

If you have been using earlier versions of mPDF, most scripts should work as before. But note:

  • Arial, Helvetica, Times and Courier are now treated like any other font

  • the whole CSS font string is parsed e.g. style=”font-family:’Lucida Grande’;” will look for a font ‘lucidagrande’

and not ‘lucida’

Configurable variables:

  • `$mpdf->useSubstitutionsMB` is now depracated, but will work as an alias for `$mpdf->useSubstitutions`
  • `$mpdf->useOnlyCoreFonts` is now depracated and is ignored. Use `new mPDF('c')`
  • `$this->use_CJK_only` is now depracated and is ignored. See `$this->useAdobeCJK` and `new mPDF('+aCJK')` or `'-aCJK'`

The initial parameters e.g. new mPDF('utf-8') have all changed. Old ones may be recognised, or will be ignored.