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.
http://www.mediawiki.org/wiki/Extension:Pdf_Export
http://tecfa.unige.ch/guides/utils/htmldoc/htmldoc.pdf
- Install HTMLDoc in ubuntu
sudo apt-get install htmldoc
- Download PHP Export
- Edit Localsettings.php in /var/www/www.example.com/wiki/ and add
require_once("$IP/extensions/PdfExport/PdfExport.php"); #$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'. - 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 - Find
'fontface' => 'times',
And Replace with'fontface' => 'helvetica',
- Then:
cd converters
And Edit HtmlDocPdfConverter.php. - Find
<title>".utf8_decode($page)."</title>
And Replace with<title>".utf8_decode($title)."</title>
sudo apt-get install git cd /var/www/www.example.com/wiki/extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfExport
http://www.mediawiki.org/wiki/Extension:Pdf_Export
http://tecfa.unige.ch/guides/utils/htmldoc/htmldoc.pdf
No comments:
Post a Comment