Jump to content

Widget:PDF: Difference between revisions

From 313FILES
Created page with "<noinclude>__NOTOC__ <big>This widget allows you to '''embed PDF files''' on your wiki page.</big> Created by [https://wiki.karlsregion.net/z/User:Wilhelm_Bühler Wilhelm Bühler] and adapted by [https://www.pro.wiki Karsten Hoffmeyer]. == Using this widget == For information on how to use this widget, see [https://www.mediawikiwidgets.org/PDF widget description page on MediaWikiWidgets.org]. == Copy to your site == To use this widget on your site, install [https://ww..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>__NOTOC__
<noinclude>__NOTOC__
<big>This widget allows you to '''embed PDF files''' on your wiki page.</big>
<big>This widget lets you 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.</big>
 
== Using this widget ==
To insert this widget, use the following code:
 
<nowiki>{{#widget:</nowiki>{{PAGENAME}}<nowiki>
|url=https://www.mediawikiwidgets.org/w/images/8/80/20171004_Beginners_tutorial_to_Semantic_MediaWiki.pdf
|width=750
|height=1050
}}</nowiki>
 
 
== Parameters ==
* '''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.


Created by [https://wiki.karlsregion.net/z/User:Wilhelm_Bühler Wilhelm Bühler] and adapted by [https://www.pro.wiki Karsten Hoffmeyer].


== Using this widget ==
For information on how to use this widget, see [https://www.mediawikiwidgets.org/PDF widget description page on MediaWikiWidgets.org].


== Copy to your site ==
To use this widget on your site, install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} complete source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
</noinclude><includeonly><object class="pdf-widget" data="<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->" 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">
</noinclude><includeonly><object class="pdf-widget" data="<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->" 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">
<p>Currently, your browser does not use a PDF plugin. You may however <a href="<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->">download the PDF file</a> instead.</p></object></includeonly>
<p>Currently, your browser does not use a PDF plugin. You may however <a href="<!--{$url|validate:url|escape:html|regex_replace:"#^(?!(https?:)?//).*#i":''}-->">download the PDF file</a> instead.</p></object></includeonly>

Latest revision as of 14:52, 10 March 2025

This widget lets you 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.

Using this widget

To insert this widget, use the following code:

{{#widget:PDF
 |url=https://www.mediawikiwidgets.org/w/images/8/80/20171004_Beginners_tutorial_to_Semantic_MediaWiki.pdf
 |width=750
 |height=1050
}}


Parameters

  • 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.