Install MediaWiki Extension PDF Export with HTMLDoc

Friday, April 5, 2013
Mediawiki support download as PDF option with use of an extension PDF Export. This post shows step-wise process to install HTMLDoc to your mediawiki. the following example is done on Ubuntu.

  1. Install HTMLDoc in ubuntu
    sudo apt-get install htmldoc
  2. Download PHP Export 
  3. sudo apt-get install git
    cd /var/www/
    git clone
  4. Edit Localsettings.php in /var/www/ and add
    #$wgPdfExportHtmlDocPath = '/usr/local/bin/htmldoc'; This path may change according to system
    $wgPdfExportHtmlDocPath = '/usr/bin/htmldoc';
    Note: to know your bin path in linux type 'echo $PATH'.
  5. First three steps complete PDF Export installation process. If you test any article in your mediawiki, it will show Print as PDF option. But If you open  PDF, the title of the page will be with underscore instead of spaces and font will be default. So further editing is required to make it look better.
    cd PdfExport
    And Edit PdfExport_body.php
  6. Find
    'fontface'      => 'times',
    And Replace with
    'fontface'      => 'helvetica',
  7. Then:
    cd converters
    And Edit HtmlDocPdfConverter.php.
  8. Find
    And Replace with
Here the installation and configuration is complete. For further support read:

No comments: