Extension:Mpdf

The Mpdf extension lets you export printable version of wiki page as PDF file. to do so it uses uses the mPDF PHP class for conversion (modified version 6.1).


 * Advantages
 * no need to install additional components
 * for generate PDF using same CSS styles as for render printable wiki page.
 * small size of the pdf file
 * supports utf-8

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

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
Here are some global variables which affect the operation of the extension. These should be set in your LocalSettings.php file after the include of the Mpdf.php script.