Extension:PdfBook

Overview
Categories are a good way of organising many articles which together make up an entire book. The sort-key's in the article's categorisation statements can be used to ensure that they're ordered properly. This extension allows such categories to be composed into downloadable PDF files with a table of contents and each article forming the start of a new chapter.

Installation
First Htmldoc needs to be installed (on Debian based systems such as Ubuntu or Mepis use: apt-get install htmldoc). Windows Binary can be found here. Then copy the extension code from Organic Design, save into your extensions directory and include into your LocalSettings.php file as usual.

I've noticed that MediaWiki 1.11 requires more memory to create large books. If your book is around a hundred articles you'll need to give PHP 64MB.

Configuration
Here are some global variables which affect the operation of the extension. These should be set in your LocalSettings file after the include of the PdfBook.php script. These configuration options can be overridden by the parser function so that they can be set specifically for each book.

Usage
The PDF creation is initialised by the pdfbook action, so a category can be downloaded as a PDF book directly from a link such as: http://www.foo.bar/wiki/index.php?title=Catgeory:Foo&action=pdfbook

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 category as a PDF book] This link can then be added to a template which can be trancluded into any category suitable for downloading as a book. For an example of such a template, see OrganicDesign:Category:I am that, which uses OrganicDesign:Template:Book to display the message and download link.

Page Breaks
You can add page breaks into your book by adding  into the relevent places in the content articles.

Bugs and Todo

 * Images not rendering properly
 * Multibyte characters not working
 * Tables are "hardwired" to a standard format currently
 * Dynamic per-book parameters not done yet