Mobile app version of vmapp.org
Login or Join
Michele947

: The localhost page isn’t working on MediaWiki I want to use Widget PDF to embed PDF files on my MediaWiki pages. So at first installed Extension:Widgets on MediaWiki and it seems it is installed

@Michele947

Posted in: #Mediawiki

I want to use Widget PDF to embed PDF files on my MediaWiki pages. So at first installed Extension:Widgets on MediaWiki and it seems it is installed (I can see it in Installed extensions list in Special:Version of the Wiki). The I copied and pasted the entire source of the PDF widget code page into a page called Widget:PDF on my Wiki:

<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.wikihoster.net 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, 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}}'''.
</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">
<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>


My PDF file is under this URL:
localhost/<wiki-name>/index.php/File:GraphicsandAnimations-Devoxx2010.pdf

And it's name is File:GraphicsandAnimations-Devoxx2010.pdf. So as described here, I added this code to my Wiki page:

{{#widget:PDF
|url=http://localhost/<wiki-name>/index.php/File:GraphicsandAnimations-Devoxx2010.pdf
|width=750
|height=1050
}}


But this error occured:

The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500


What I did:


Also I tried this (original example of the Widget PDF)

{{#widget:PDF
|url=https://www.semantic-mediawiki.org/w/images/e/e9/SMW_quick_reference.pdf
|width=750
|height=1050
}}


But result was the same.
I read Extension talk:Widgets but did not find any thing.
I opened Chrome DevTools (Ctrl+Shift+I), but there was no error.


How I can solve the problem?

Edit:

After some times, I tried to uninstall Widget PDF and Extension:Widgets and reinstall them. So I removed Extension:Widgets files/folder from $IP/extensions/ and also deleted Widget:PDF page from Wiki. Then I installed Extension:Widgets again, but now, I can not open the Wiki pages at all (I see above error again), unless I delete require_once "$IP/extensions/Widgets/Widgets.php"; from LocalSettings.php. So I even cannot try to load Extension:Widgets.

Now I see this error in DevTools:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)


Also after uninstalling Extension:Widgets, I tried Extension:PDFEmbed and unfortunately again I saw above error.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

2 Comments

Sorted by latest first Latest Oldest Best

 

@Michele947

I could not solve above problem for using extensions to embedding PDF in MediaWiki. So finally I used $wgRawHtml and uesed this code in my Wiki page:

<html>
<embed src="http://localhost/<wiki-name>/images/5/59/GraphicsandAnimations-Devoxx2010.pdf#page=14" width="1200px" height="500px" />
</html>

10% popularity Vote Up Vote Down


 

@Hamaas447

No idea if this will help, but the first thing I would try would be replacing localhost with the IP address 127.0.0.1

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme