Loading...
 
Skip to main content

History: mPDF

Source of version: 83 (current)

Copy to clipboard
            {syntax type="markdown"  editor="wysiwyg"} # {icon name="file-pdf-o"} mPDF

## Overview

**mPDF** is a PHP class which generates PDF files from UTF-8 encoded HTML. It is based on FPDF and HTML2FPDF, with a number of enhancements. **mPDF** was written by Ian Back and is released under the GNU GPL v2 licence. 
**mPDF** is manually installable in Tiki since Tiki 15.2. Since ((Tiki18)) you can install **mPDF** with the new **((Packages))** feature from the Tiki admin panel in a few clicks.

**More info**

| Github | [https://github.com/mpdf/mpdf] |
|---|---|
| Documentation | [https://mpdf.github.io/] |


{REMARKSBOX(close=n type=tip title="PDF Output of Tiki content with 'mPDF'")} 
((dev:Online Publishing House - Output formats|All Free / Libre / Open Source PDF generation solutions were analyzed)) and mPDF was selected as the overall best solution for deep integration in Tiki. The main reasons are:

1. Vast feature set: The [https://github.com/IanNBack/mpdf/raw/master/mpdfmanual.pdf|mpdfmanual.pdf (8 megs download)] is over 600 pages!
2. It's written in PHP (like Tiki) so it eases deployment, facilitates integration and makes it easier for the Tiki community to contribute.
3. The approach is to convert HTML to PDF (other approaches would have been more complex / less suitable for the Tiki context)
4. Strong multilingual support: Some of the other good solutions didn't support all languages. And thus, it would have forced us to have a second solution for these languages, which would have fragmented the efforts.


Since the GNU GPL v2 licence is not compatible with Tiki's LGPL licence, we cannot ship **mPDF** with the source code as part of Tiki. Integration code has been added to Tiki, and you can install mPDF via ((Packages)) in ((Tiki18)).

See also:

- http://wikisuite.org/blogpost10-mPDF-7-0-0-Released
- http://wikisuite.org/blogpost5-Tiki17-makes-collaborative-digital-publishing-a-breeze

{REMARKSBOX}

{maketoc}

## Installation

1. Enable **mPDF** in Tiki: login to your Tiki and go to example.org/tiki-admin.php?page=print and set the following preference: PDF from URL: mPDF
2. If mPDF is not installed, you can install mPDF via the ((Composer Web Installer))

{img src="display1494"}

## Configuration

**mPDF** works well with Tiki out-of-the-box even on average shared hosting. There are many options at tiki-admin.php?page=print, most of which can be overridden page by page via ((PluginPDF)) 
{img src="display1495"}

If you are programmer, you may want to look in \*/mpdf/config.php for additional configuration options.


{include page="PDF related pages"}