Extension:ConvertPDF2Wiki
ConvertPDF2Wiki Release status: stable |
|
---|---|
Implementation | Special page , API |
Description | Allows users to import a PDF and convert it to a wiki page, including embedded images |
Author(s) | Bertrand Gorge (BertrandGorgetalk) |
Latest version | 1.0 (2024-12-09) |
Compatibility policy | Master maintains backward compatibility. |
MediaWiki | 1.39+ |
PHP | 8.1+ |
License | GNU General Public License 2.0 or later |
Download | GitHub: Note: https://github.com/neayi/mw-convertPDF2Wiki/blob/main/README.md |
The ConvertPDF2Wiki extension allows a PDF to be imported as a wiki page, extracting images and text as much as possible.
Usage
editThis extension adds a special page, "Special:Import_PDF", that allows you to upload a PDF file (or point to the URL of a PDF file somewhere on the web) and then converts the PDF to a wiki, creating a new page.
The process is as follows:
- Go to the new special page: "Special:Import_PDF"
- Select the PDF file
- Choose the images you want to keep (get rid of logos or other nonessential images)
- Rotate images that might be upside down
- Select a title for the new page in the wiki (a default title is guessed from the PDF document)
- Edit your page to polish the details (tables might need to be recreated, etc...)
The selected images are imported with a name that matches the page title and added at the bottom of the page in case they do not appear in the text's flow.
If the title matches an existing page, the converted text is added at the bottom of the existing page.
Installation
edit- Install the software required for this extension to work.
- Download and place the file(s) in a directory called
ConvertPDF2Wiki
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'ConvertPDF2Wiki' );
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Dependencies
editThe extension relies on the following three utilities that must be installed as well:
ImageMagick
editImageMagick is used to rotate the images. See: https://imagemagick.org/
To install:
$ pecl install imagick
pdftohtml
editPDFtoHTML is used to convert the PDF to an HTML document. See: https://poppler.freedesktop.org
To install:
$ apt-get install poppler-utils
Pandoc
editPandoc is used to convert from HTML to Wikitext. See https://pandoc.org/installing.html
To install:
$ apt-get install pandoc
See also
editHere are some other extensions that do a similar job with Docx documents (PDF can also easily be converted to docx):