Extension:Pdf Export
From MediaWiki.org
|
Release status: stable |
|
|---|---|
| Implementation | Special page, Data extraction |
| Description | Converts current page to PDF and sends to browser |
| Author(s) | Thomas Hempel |
| Last Version | 2.2.1 (2009-10-19) |
| MediaWiki | 1.14 |
| License | No license specified |
| Download | see here |
| Example | Syncleus Wiki Example |
|
check usage (experimental) |
|
Contents |
[edit] Overview
This extension lets you view wiki pages as PDF. It has two modes:
- For any given page, it acts like the SpecialCite.php extension and provides a link in the toolbox to view that page as Pdf.
- 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);
[edit] 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:
require_once("extensions/PdfExport/PdfExport.php");
[edit] Version history
[edit] See also
- Extension:Collection - allows to build collections from a number of pages. Collections can be edited, persisted and retrieved as PDF
- Extension:Pdf Book - composes categories of articles into a book in PDF format, also uses HTMLDOC
- Extension:Pdf Export Dompdf - a modified version of Pdf Export, using dompdf, it will run on shared hosting servers too
[edit] 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)