Extension:PDFEmbed

From MediaWiki.org
Jump to: navigation, search
For MediaWiki installations running on PHP version older than 5.4, you will have to use the compat branch of this extension from the GitHub repository.
MediaWiki extensions manual
Crystal Clear action run.png
PDFEmbed

Release status: stable

Implementation Tag, Media
Description Allows to embed PDF files into a page
Author(s) Alexia E. Smithtalk
Latest version 1.1.1 (2014-11-19)
MediaWiki 1.19+
PHP 5.4+
Database changes No
License GNU Lesser General Public License 3.0
Download
Example The Vault
Parameters

$pdfEmbed (width, height)

Tags
pdf
Hooks used
ParserFirstCallInit

Translate the PDFEmbed extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

The PDFEmbed extension allows PDF files (uploaded to your wiki) to be embedded into a wiki page using <pdf></pdf> tags. The PDF file extension is automatically added and necessarily default permissions are configured. Future functionality will allow this extension to act as a media handler for PDF files.

Installation[edit | edit source]

  • Download and extract the file(s) in a directory called PDFEmbed in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/PDFEmbed/PDFEmbed.php";
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Configuration[edit | edit source]

If the default configuration needs to be altered add these settings to the LocalSettings.php file below the require:

//Default width for the PDF object container.
$pdfEmbed['width'] = 800;
 
//Default height for the PDF object container.
$pdfEmbed['height'] = 1090;

Usage Example[edit | edit source]

The PDF to be embedded must first be uploaded to the wiki through "Special:Upload". The namespace prefixed file name is then used between the tags to embed it in a page.

<pdf>File:Example.pdf</pdf>

With optional width and height.

<pdf width="500" height="300">File:Example.pdf</pdf>

Change Log[edit | edit source]

v1.1.1[edit | edit source]

v1.1[edit | edit source]

  • Fix PHP notices being thrown for some parameters.
  • Missing language string.

See also[edit | edit source]