Extension:UploadPDF

The UploadPDF extension plugs into Upload series, and automatically converts PDF files into JPEG images during the upload process. This was originally intended for engineering drawings. This replaces functions of the Upload Class just enough to convert the file before wiki storage processing, Contains all the same hooks as its parent class, and therefore compatibility with other upload extensions. This extensions is only a partial replacement of upload class.

Usage
For use with Single Page PDF images and slides. Go to the default MediaWiki upload page, Special:Upload. Upload files as usual. This extension automatically detects the pdf extensions and makes the necessary changes, even to the destination filename. There are no added special pages with this extension, just a change in the Upload class used for the upload. This means all rights that apply to the Upload still apply.

Installation
Not sure if you require the  because this hook changes the file parameters processed by the UploadBase class before the File verification processes. Still recommended so the extension shows in allowed file types on the Upload page.

DESIGNED FOR UNIX\LINUX SHELL ONLY IN THIS VERSION This script requires ghostscript. If you need it for windows, or OS\X, download at the previous link, and change the appropriate lines below: in UploadPDF-body.php to the appropriate commands for the operating system:

Windows  OS/2
 * gs->gswin32c
 * rm->del
 * gs->gsos2

Code
This still has a lot of wfDebug statements. I'm new to php, and figured out some of the variable and function passing properties the hard way.


 * UploadPDF.php


 * UploadPDF-body.php