MediaWiki PDF export

From EnneEnneWiki

Jump to: navigation, search

According to this page you can convert into PDF your MediaWiki pages. However I decided to make a little modification to that solution in order to simplify its installation and avoiding to copy file index.php.

To install my patch you can simply download and apply it with the command:

goldrake:/usr/share/mediawiki# patch < index.php.patch

Then create a folder called printouts - gave it the same privileges as images as well as the same .htaccess file.

Now, the coding is very simple and works similar above page like this: (I'll call this page "Test Print")

  • Put articles that will appear in sequence in curly braces:
{Help-style indexing}
{Email Digest}
  • and put articles to combine into a single set of curly braces separated by the | pipe symbol.
{Word doc search | PDF doc search | Excel doc search}
  • These articles will not have a page break in the PDF file. This is really useful for articles that are short and related, such as a function list.
  • Then add a link to this page adding format parameter as follow:
[http://yoursite.com/index.php?title=Test_Print&format=PDF Print these articles]

Now when a user browses to this page on your site and clicks the above link, the page will re-output through index.php but executing the new code. The page will be changed from looking like this:

{Help-style indexing) {Email Digest} {Word doc search | PDF doc search | Excel doc search}
Print these articles

to this:

{Email Digest} {Word doc search | PDF doc search | Excel doc search}
Print these articles
Creating: (Email Digest) Creating: (Word doc search) Creating: (PDF doc search) Creating: (Excel doc search)
Test_Print.pdf
Personal tools
Google AdSense