Extension:Mpdf

The Mpdf extension lets you export the printable version of a page as a PDF file. To do so it uses uses the "mPDF PHP class" in version 6.1 for HTML to PDF conversion.


 * Advantages
 * no need to install additional components
 * the generated PDF uses the same CSS styles as for rendering the printable version of the page
 * small size of the PDF file
 * supports UTF-8

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.
 * About mPDF

Usage
The PDF creation is initialised by the mpdf action, so a page can be downloaded as a PDF file directly from a link such as: https://www.example.org/wiki/index.php?title=Main_Page&action=mpdf

A more generic way of creating the link is to use the "fullurl" parser function and the FULLPAGENAMEE built in variable as in the following example. [ download this page as a PDF file] This link can then be added to a template which can be transcluded into any page for downloading as a PDF file.

Customization
Use parser function  to add tags specified in documentation of mpdf class.


 * Examples

Raw HTML output
You can download the file as a single HTML document by setting format=html in the query-string.

https://www.example.org/wiki/index.php?title=Main_Page&action=mpdf&format=html
 * Example

Configuration
This extension offers one configuration parameter. It should be set in your "LocalSettings.php" file after the inclusion of the extension.


 * Whether or not an action tab is wanted for export to PDF (defaults to )
 * Whether or not an action tab is wanted for export to PDF (defaults to )