Extension:Pdf Export

Overview
This extension lets you view wiki pages as PDF. It has two modes:
 * 1) For any given page, it acts like the SpecialCite.php extension and provides a link in the toolbox to view that page as Pdf.
 * 2) If you invoke the Pdf Export special page directly, it lets you select a group of wiki pages and output them as a single pdf document. In that view you can also choose orientation (landscape vs portrait) and paper size.

The extension works with the open source htmldoc package. It works by rendering the current page without all the navigation stuff and writing it to a temp file. The temp file is passed through htmldoc which sends the PDF back to the browser.

The current version works with recent versions of MediaWiki, with a few tweaks it works with 1.6.7 and newer as well.

You'll need to make sure the paths are right(put htmldoc in Path environment variable). If you're having trouble with the images rendering, you may have to fiddle with how the pathnames get generated for them. In general the easy way to debug this extension is to comment out the line that removes the temp file. That way you can both check and hand-code the temp file, as well as manually run it through htmldoc to see what happens. Try commenting out $bhtml = str_replace ('/w/',$wgServer . '/w/', $bhtml);

Installation
The only prerequisite is installing Htmldoc (on Debian based systems such as Ubuntu or Mepis use: apt-get install htmldoc). Windows Binary can be found here (v1.8.27).

Get and save the Source Code, making sure there are no trailing spaces (or you will get a header error). Then add the following to your LocalSettings.php: Finally, if it does not already exist, create tmp subdirectory in the images directory.

Version history

 * version history

List of possible Improvements

 * Images should be scaled down to the pagesize, so they do not get cut off.
 * Currently, only one link level is ever included. Please include nested links as well. (TOCLevel doesn't change anything)