Extension:PdfHandler

From MediaWiki.org

Jump to: navigation, search

           

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
PdfHandler

Release status: stable

Implementation  Media
Description Handles PDF files like multipage DJVU
Author(s)  xarax <jodeldi at gmx dot de>
Last Version  0.2 (2007-09-06)
MediaWiki  1.11
License GPL
Download Download snapshot

Subversion [Help]
Browse source code

Example  wikimediafoundation.org example
usability.wikimedia.org example
j-crew.de example

check usage (experimental)

This is the README file for the PdfHandler extension for MediaWiki software. The extension is only useful if you've got a MediaWiki installation; it can only be installed by the administrator of the site.

The extension shows uploaded pdf files in a multipage preview layout. With enabled WebStore the extension generates automatically Images from the specified page.

This is the first version of the extension and it's almost sure to have bugs. See the BUGS section below for info on how to report problems.

Contents

[edit] License

Copyright 2007 xarax (s:de:Benutzer:Xarax)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

[edit] Pre-requisites

This software was tested with 1.11alpha (r25574) - 1.12alpha (r28001) - 1.13.0rc1. It may or may not work with earlier or later versions, but please test it.

It requires the following packages:

It needs at least PHP 5.1.3 to work (dependency on SimpleXMLElement::addChild).

[edit] Installation

To install, copy all the files in the archive you downloaded to the PdfHandler subdirectory of the extensions subdirectory of your MediaWiki installation.

In your MediaWiki LocalSettings.php, add the following line some place towards the bottom of the file:

require_once("$IP/extensions/PdfHandler/PdfHandler.php");

Then you must defined some variables in your LocalSettings.php:

  • $wgPdfProcessor - path to your ghostscript implementation
  • $wgPdfPostProcessor - path to your imagemagick convert
  • $wgPdfInfo - path to your pdfinfo
  • $wgPdfOutputExtension - defaults to jpg
  • $wgPdfHandlerDpi - defaults to 150 dpi

Example for a WindowsXP installation:

$wgPdfProcessor = 'C:\Programme\gs\gs8.60\bin\gswin32.exe';
$wgPdfPostProcessor = $wgImageMagickConvertCommand;
$wgPdfInfo = 'C:\Programme\xpdf-3.02pl1-win32\pdfinfo.exe';

Example for a Ubuntu installation:

$wgPdfProcessor = 'gs';
$wgPdfPostProcessor = $wgImageMagickConvertCommand;
$wgPdfInfo = 'pdfinfo';

[edit] Usage

The usage of the PdfHandler extension is without user interaction. If you upload a new pdf file, the metadata will be stored in the database, and then this file can be shown in a multipage preview layout like the djvu handler does. The extension does not render PDF files that were uploaded prior to installation; they will be displayed in the same way as before.

[edit] Bugs and enhancements

Bugs can be reported at Bugzilla

[edit] See also

This extension is being used on one or more of Wikimedia's wikis. It means that the extension is stable and works well enough to be used by such high traffic websites. A full list of the extensions installed on a particular wiki is produced by Special:Version on that wiki.