Difference between revisions of "Widget:PDF"

From LID SWM Planning and Design Guide
Jump to navigation Jump to search
(Created page with "{{Widget |description=Allows you to add a PDF file to a page. |author=Wilhelm Bühler, Karsten Hoffmeyer, |status=active }} This widget allows you to add any PDF file to your...")
 
m
 
Line 1: Line 1:
{{Widget
+
<noinclude>__NOTOC__
|description=Allows you to add a PDF file to a page.
+
<big>This widget allows you to '''embed PDF files''' on your wiki page.</big>
|author=Wilhelm Bühler, Karsten Hoffmeyer,
 
|status=active
 
}}
 
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:
+
Created by [https://wiki.karlsregion.net/z/User:Wilhelm_Bühler Wilhelm Bühler] and adapted by [https://www.wikihoster.net Karsten Hoffmeyer].
  
<nowiki>{{#widget:</nowiki>{{PAGENAME}}<nowiki>
+
== Using this widget ==
|url=https://www.semantic-mediawiki.org/w/images/e/e9/SMW_quick_reference.pdf
+
For information on how to use this widget, see [https://www.mediawikiwidgets.org/PDF widget description page on MediaWikiWidgets.org].
|width=750
 
|height=1050
 
}}</nowiki>
 
  
== Parameters ==
+
== Copy to your site ==
* '''url''' - URL of the PDF file being inserted
+
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
* '''width''' - maximum width of the iframe (default is 960 for landscape format / set to 750 for portrait format )
+
</noinclude><includeonly><object class="pdf-widget" data="<!--{$url|validate:url}-->" type="application/pdf" wmode="transparent" style="z-index: 999; height: 100%; min-height: <!--{$height|escape:'html'|default:680}-->px; width: 100%; max-width: <!--{$width|escape:'html'|default:960}-->px;"><param name="wmode" value="transparent">
* '''height''' - minimum height of the iframe (default is 680 for landscape format / set to 1000 for portrait format )
+
<p>Currently your browser does not use a PDF plugin. You may however <a href="<!--{$url|validate:url}-->">download the PDF file</a> instead.</p></object></includeonly>
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 ==
 
{{#widget:{{PAGENAME}}
 
|url=https://www.semantic-mediawiki.org/w/images/e/e9/SMW_quick_reference.pdf
 
|width=750
 
|height=1050
 
}}
 
 
 
== Related tip ==
 
The [[Template:PDF|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 [[Template:PDF|PDF template]] for further information.
 
{{Comments}}
 

Latest revision as of 23:22, 9 November 2017

This widget allows you to embed PDF files on your wiki page.

Created by Wilhelm Bühler and adapted by Karsten Hoffmeyer.

Using this widget

For information on how to use this widget, see widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:PDF.