From MediaWiki Widgets

PDF widget
Description:Allows you to add a PDF file to a page.
Author:Wilhelm Bühler, Karsten Hoffmeyer
Updated:December 4, 2016
If you use code on your wiki which is older than this date you may want to update since your widget may be insecure or broken.
Inv-Icon tools.svg.png

To copy this widget to your wiki, cut and paste the entire source of the PDF widget code page into a page called Widget:PDF on your wiki.

If you don't have the Widget extension set up on your wiki, go to its description page on and follow the installation instructions.

This widget allows you to add any PDF file to your site. In case your browser does not support a PDF plugin a link to download the file will be shown instead.

To insert this widget, use the following code:



  • url - URL of the PDF file being inserted
  • width - maximum width of the iframe (default is 960 for landscape format / set to 750 for portrait format )
  • height - minimum height of the iframe (default is 680 for landscape format / set to 1000 for portrait format )

Usually it is not required to add the height and width parameter for PDF files in landscape format since the display will resize automatically. If you do so it is recommended to have a ration of 1.41 between width and height. However do use the parameters with recommended values for PDF files in the portrait format. This also will resize automatically.

Sample result

Currently your browser does not use a PDF plugin. You may however download the PDF file instead.

Related tip

The PDF template used together with the PDF widget helps to avoid adding the full URL of a locally uploaded file to the widget's "url" parameter by rather just specifying the name of the uploaded file. → See the PDF template for further information.


blog comments powered by Disqus