Extension talk:PDFEmbed
This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Error if not declaring width and height
Hi, I've just installed this very interesting extension using the default values and config but i have a problem:
if I leave all as default, when I save the page in which I have embedded a PDF using <pdf>File:name.pdf</pdf>, I get this error message at the top of the page:
Notice: Undefined index: height in C:\wamp\www\kb\extensions\PDFEmbed\PDFEmbed.hooks.php on line 66. However I can see the PDF embedded into the page
The error disappear if I use <pdf width="xxx" height="yyy">File:name.pdf</pdf>
I tried to explicit the WIDTH and HEIGHT parameters in the config.php but without any success.
I use mediawiki 1.19 85.40.211.228 11:26, 28 February 2014 (UTC)
- Hi,
- I have the same problem. I've found an explanation : if you don't have any height or width, the following lines (65-66) in PDFEmbed.hooks.php make a warning :
$width = ($args['width'] > 0 ? intval($args['width']) : intval($pdfEmbed['width'])); $height = ($args['height'] > 0 ? intval($args['height']) : intval($pdfEmbed['height']));
- So, waiting next release of PDFEmbed, just before these two lines above, insert these lines :
if (!isset($args['width'])) { $args['width'] = 0; } if (!isset($args['height'])) { $args['height'] = 0; }
- I'm not proud of myself, 'cause that's not clean, but it works! Cahuet (talk) 17:27, 3 November 2014 (UTC)
- I opened a new issue on the Github project for this. I should be able to get to it this week or next.
- https://github.com/Alexia/PDFEmbed/issues/3 Alexia E. Smith (talk) 17:49, 3 November 2014 (UTC)
- I just put out the official fix along with a couple other fixes. Alexia E. Smith (talk) 20:23, 4 November 2014 (UTC)
- Thank you very much Alexia... I obviously prefer your code. 38.127.136.234 00:57, 5 November 2014 (UTC)
parser error
i'm using mediawiki 1.19.2 and when using this extension, i get a parser error at line 15 in PDFEmbed.i18n.php. 106.68.249.46 05:45, 6 March 2014 (UTC)
- I've put in a pull request in the git repository for this extension that should fix your issue. Sounds like you're using a PHP version that doesn't support square bracket arrays, which is a new feature in PHP 5.4 and newer versions. If you don't want to wait for the pull request to be merged, you can go ahead and copy the change I made to your MediaWiki installation. :)
- Hopefully that works! GeorgeBarnick (talk) 05:50, 6 March 2014 (UTC)
- In follow up to my last message, the author of the extension has created a 'compat' branch in the extension's GitHub repository. Go ahead and download that branch and replace the incompatible version of the extension you have, and things should work fine. :) Let me know if you have any further issues with the extension. GeorgeBarnick (talk) 06:33, 6 March 2014 (UTC)
- Thanks for that patch. However, there's another array fix in PDFEmbed.hooks.php in line 37. Wess (talk) 12:54, 25 August 2015 (UTC)
de.json
Hi again, another
de.json
{
"@metadata": {
"authors": []
},
"pdfembed": "PDF Embed",
"pdfembed_description": "Media-Handler-Extension für PDF-Dateien.",
"embed_pdf_no_permission": "Zum Einbetten von PDFs fehlen entsprechende Benutzerrechte.",
"embed_pdf_blank_file": "URL bzw. Dateipfad zum Einbetten ist leer.",
"embed_pdf_invalid_file": "URL bzw. Dateipfad existiert nicht.",
"embed_pdf_invalid_user": "Ein ungültiger Benutzer wurde angegeben.",
"pdf_not_supported": "Die PDF-Datei wurde nicht richtig geladen oder der verwendete Browser kann kein PDF anzeigen. Das PDF <a href=\"$1\">$2</a> herunterladen."
}
Cheers Messerjokke79 (talk) 22:20, 15 November 2014 (UTC)
- I have created a pull request for Alexia. Thanks for providing the translation. [[kgh]] (talk) 15:17, 17 November 2014 (UTC)
syntax error, unexpected '['
When I try to use runJobs with this extension enable I get this error
PHP Parse error: syntax error, unexpected '[' in /var/www/html/mw/extensions/PDFEmbed/PDFEmbed.php on line 16
Legaulph (talk) 12:24, 23 February 2015 (UTC)
- Make sure to upgrade your PHP installation to 5.4 or higher. Otherwise if you can not upgrade then use the 5.3 compatibility branch. Alexia E. Smith (talk) 15:24, 23 February 2015 (UTC)
- Thank you for your response
- I'm currently using
- MediaWiki 1.23.8
- PHP 5.4.16 (apache2handler)
- MySQL 5.6.19-log
- Semantic MediaWiki 2.1 148.177.1.211 20:53, 24 February 2015 (UTC)
- Thank you for your response
- Thank you Legaulph (talk) 17:41, 1 April 2016 (UTC)
Directory Path
So I've gathered this looks in the "images" directory as the default location for the PDF referenced in the wiki code. Is there a way to adjust the directory path that the extension looks to for the file?
I'd like to places all PDF files in a folder called "documents" that would reside in the "images" directory. Jpwake77 (talk) 19:16, 20 April 2015 (UTC)
- PDFEmbed uses Mediawiki's built in upload system. For legacy Mediawiki reasons this folder is named images and does not actually really mean it is only for images. Alexia E. Smith (talk) 22:20, 28 April 2015 (UTC)
any chances to have a "zoom" parameter/option?
Hello, thanks for your good work! I just wanted to know if there are any chances to get a "zoom" parameter for this extension same as it works for "width" or "height". Thanks! Goliva1981 (talk) 12:36, 4 June 2015 (UTC)
not working on android mobile
perhaps it will be possible in the future to have an update of this extension ( I use the 1.1.2 version ) ?
because this plugin doesn't work on mobile (but it is OK on pc window)
here is an exemple of wordpress plugin which works with pc and mobile
it is very nice to view the pdf document directly on the web page of my mobile (I check that it works with chrome, firefox, dolphin android browser
from playstore)
Chantoune (talk) 14:27, 15 February 2016 (UTC)
- Discussion handled at Project:Support desk/Flow/2016/02#h-PDFembed_doesn't_work_on_Android-2016-02-14T18:10:00.000Z Ciencia Al Poder (talk) 19:04, 21 February 2016 (UTC)
Users unable to embed PDF
MediaWiki | 1.25.5 |
When trying to embed a PDF the user is getting:
"you don't have permission to embed pdf files"
If I edit as admin and save it I get the same error.
I have to delete it save then edit and add the link and save then it is successful Legaulph (talk) 14:57, 23 February 2016 (UTC)
- Are you using <pdf>File:FooBar.pdf</pdf> ?
- I just had the same issue and am kicking myself for it now. Pisnaz (talk) 23:49, 22 March 2016 (UTC)
- Having the same issue as well any ideas 165.228.93.174 (talk) 08:42, 29 March 2016 (UTC)
- Seems I had other issues as well once I started using my bot and normal users.
- There is a
embed_pdf
permission showing now, that I did not see before. It seems it is only on Administrators by default. - For my Bot uploads I simply added in
$wgGroupPermissions['bot']['embed_pdf'] = true;
to my LocalSettings.php - I am running:
MediaWiki | 1.26.2 |
PDFEmbed | 1.1.2 |
- That worked great! now that that has a permission line I can get my users to see or embed. Thanks a bunch! 209.159.235.12 (talk) 13:58, 17 April 2017 (UTC)
- Hello,
- I have added the
$wgGroupPermissions['*']['embed_pdf'] = true;
to my LocalSettings.php but I still get the error-message "you don't have permission to embed pdf files". MW Version 1.31.1 - What else can I check?
- Thanks in advance! 77.20.30.72 (talk) 16:44, 3 January 2019 (UTC)
- Anyone on this problem ? 217.19.146.36 (talk) 12:41, 1 February 2019 (UTC)
- Hi,
- I've installed the Extionsion, and can upload PDF files to our MediaWiki 1.31.
- However, after linking to the uploaded file, and saving the page, a empty square shows, where the PDF image should be.
- When I check the source code of the page, an URL is listed, and when I click on the URL, the PDF is opened.
- All this happens in Google Chrome.
- I also installed this extension in our TestWiki, and there I have no issues! Same browser., same Wiki version IMTS-TB (talk) 12:07, 14 February 2020 (UTC)
- Hi
- You have to replace line 92 in the PDFEmbed.hooks.pdf file
- OLD
- 'src' => $file->getFullUrl().'#page='.$page,
- NEW
- 'src' => preg_replace("/^http:/i", "https:", $file->getFullUrl()).'#page='.$page,
When not changed, you get an empty square, cause your side is loaded with https and the extension uses http, mixed content, blocked in chrome for example. 212.236.21.221 (talk) 11:56, 17 June 2020 (UTC)- Because my website uses https protocol, the embedding of PDF mixed (http (pdf url) and https page).
- To get this working in the pdfembed for version 1.35 I added the line
- $url = str_replace("http:", "https:", $url); after line 190.
- That fixed it for me. 2001:1C05:480:AA00:E27B:D6A9:1279:1933 (talk) 10:54, 2 February 2024 (UTC)
- In case anyone is reading this in 2023
- I had the same problem but only admins could embed, with ordinary users getting no dice. In my case this was a permissions problem which can be verified via special:user group rights
- admins had embed_pdf set, but ordinary users did not.
- The fix is to edit LocalSettings.php and add:
- $wgGroupPermissions['user']['embed_pdf'] = true; Polymath uk (talk) 11:08, 10 January 2023 (UTC)
Problem with passing parameters inside a template
Hello,
The users on our wiki are used to embeding lots of different file formats. They use syntax similar to this:
{{Template:someTemplate
|file=some file.pdf
|size=L
}}
We are using sizes 'L', 'M', .. to get a unified look on all of the pages.
The height and width is then controlled in our template, which translates it from 'L' to some preset number. This works for many different use cases.
The problem with PDFEmbed is, that I'm not able to get it to function with a 'dynamic' parameter.. I would need to use something like this:
<pdf width="{{{width}}}" height="{{{height}}}">File:SOme pdf file.pdf</pdf>
But '{{{parameter}}}' just doesn't get parsed correctly..
Thanks for all of the help (and sorry if my understanding of the extension is subpar - i'm new to mediawiki and php...)
How to disable the tool option to prefent non-users to download
Would it be possible to block unregistered users to download the pdf file.
Have a look here: Harry H. Arends 20:33, 27 November 2016 (UTC)
PDFEmbed.php is missing in Dowload Version 2.0
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
After downloading the version 2.0 I relised the file PDFEmbed.php is missing in the zip. there is only PDFEmbed.hooks.php and then - of course - require_once "$IP/extensions/PDFEmbed/PDFEmbed.php";
fails.
Could you please add the file in your zip, please? M art in (talk) 14:21, 25 January 2017 (UTC)
- I updated the installation instructions. You should switch over to extension registration style loading. Alexia E. Smith (talk) 16:18, 30 January 2017 (UTC)
- Hi Alexia,
- I am have the same problem and am a bit of a novice with mediawiki. How do I switch over to extension registration style loading? I didn't see that in the instructions. I'm also running Wikimedia on Windows.
- Thanks,
- Keith 137.191.228.226 (talk) 09:30, 31 January 2017 (UTC)
- The installation instructions haven't really been updated, Alexia. There is still a reference to require_once "$IP/extensions/PDFEmbed/PDFEmbed.php";
- But this code cannot be used anymore, since the file PDFEmbed.php doesn't exist in the download. Does this mean it is not possible to use the extension for Mediawiki version 1.24 or older? Labrekke (talk) 15:02, 30 June 2017 (UTC)
- I updated the documentation on MediaWiki.org to indicate that extension registration is required. Alexia E. Smith (talk) 21:42, 26 July 2017 (UTC)
Not working with #var: ?
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
In my case I compose the filename of the PDF within a template together Extension:Variables
The printout of {{#var:pdfpath}}
looks ok - including: "File:..." but
<pdf width="500" height="300">{{#var:pdfpath}}</pdf>
fails? Any hints?
Thanks for help M art in (talk) 14:54, 25 January 2017 (UTC)
- I added
- if (strstr($file, '{{') !== false) { $file = $parser->recursiveTagParse($file, $frame); }
- in line 45 of file PDFEmbed.hhoks.php and it's working fine now! M art in (talk) 15:19, 25 January 2017 (UTC)
File Usage doesn't recognize usage of embedded pdf
Hi,
We uploaded a PDF to our MediaWiki and then used PDFEmbed to show the file on a page. I noticed that the File Usage section of the uploaded PDF has the message "There are no pages that link to this file."
The PDF shows up just fine. Is there a way to make MediaWiki recognize that the file has been used when embedding with this plugin? We embedded using the following syntax:
<pdf>File:filename.pdf</pdf>
Thanks,
-Dan Daniel.Humphrey (talk) 19:51, 13 April 2017 (UTC)
- Any chances to review this? RodolfoEBDR (talk) 20:07, 31 July 2018 (UTC)
Is the version on Git correct
So i had problem of showing the PDF embedded ion the browser.
There was still version 1.12 on the wiki so i got the new 2.0.0 version and uploaded it.
Checking the version at but is show version 1.12 installed.
And <pdf>Bestand:KT00804.pdf|KT 00.804</pdf> gives this text on the page: The URL or file path given does not exist.
embed pdf error
i have installed pdfEmbed 2.0.1 in mediawiki and have uploaded the pdf document thru upload files in mediawiki. its showing a warning as application/PDF privacy consideration and the output on the pdf embed page showing as "The URL or file path given does not exist."
Please help me to resolve this issue. 182.72.144.54 (talk) 11:31, 2 August 2017 (UTC)
- I have the same error,
- Since 3 months before it works fine, ..
- Can you help us?
- Thank .
- guindelo 83.247.136.44 (talk) 12:48, 9 April 2018 (UTC)
- I have the same error,
- Since 3 months before it works fine, ..
- Can you help us?
- Thank .
- guindelo Guindelo (talk) 12:50, 9 April 2018 (UTC)
- Same issue for me also, Pls suggest any other extension or any fixed build. Pooja2425 (talk) 11:23, 17 September 2021 (UTC)
Automatically fit to width
Hi, is it possible to command the pdf to automatically fit to width? 212.83.194.34 (talk) 09:58, 14 June 2018 (UTC)
- Change the file PDFEmbed.hooks
- static private function embed(File $file, $width, $height, $page) {
- return Html::rawElement(
- 'iframe',
- [
- //'width' => $width,
- 'width' => '100%',
- 'height' => $height,
- 'src' => $file->getFullUrl().'#page='.$page,
- 'style' => 'max-width: 100%;'
- ]
- );
- } RodolfoEBDR (talk) 14:23, 2 August 2018 (UTC)
IE 11 Compatibility problem
Note that this extension will not necessarily work on IE as intended. On my testing on a new install of IE 11, the pdf was not embedded on the page but instead opened a prompt to download the file. See: https://stackoverflow.com/a/12974315/498730 for more info that I have found about this problem. VOIstri (talk) 18:36, 21 July 2018 (UTC)
Blank Frame and no PDF displaying
RESOLVED | |
There was an error with the $wgServer parameter. After hardcoding the URL of the server, it worked. |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hi! I'm using PDFEmbed 2.0.1, PdfHandler (21f2fe9) and MW 1.31. Wiki works fine but PDF Embedding isn't working. It displays a blank frame where is supposed to appears the PDF file. There's nothing rare with folder permissions. It isn't an user permission on editing the page (I'm trying as administrator).
Any ideas? RodolfoEBDR (talk) 19:38, 23 July 2018 (UTC)
- PS: the frame is outlined. It seems like the PDF is not being loadead o something, but no error is adviced. When inspecting the source code, the frame refers to "about:blank" in Firefox (and in Chrome it replicates the current page, like an frame embedding the page itself)
- Here's how it looks like: https://imgur.com/dZjX8Fw RodolfoEBDR (talk) 19:43, 23 July 2018 (UTC)
- I have the same issue. Chrome is telling me that the pdf file is being transfered thru HTTP while the rest of our site is using HTTPS and that this is considered unsure.
- Not sure how to solve this.
- "Mixed Content: The page at 'https://wiki-test.domain.net/index.php/test_24' was loaded over HTTPS, but requested an insecure resource 'http://wiki-test.domain.net/images/5/57/test.pdf#page=1'. This request has been blocked; the content must be served over HTTPS." 194.237.95.149 (talk) 12:24, 24 July 2018 (UTC)
- When inspecting debug mode in Firefox over the frame, it says:
Could not load the source for blob:https://192.168.0.154/f48cbb41-9ec6-467b-ac78-e683b4216b0e.
- I don't know what is trying to parse the extension. Thumbnails are being generated correctly, so that means that the files in images/ can be located. Please help us!!! Hahaha RodolfoEBDR (talk) 12:49, 24 July 2018 (UTC)
- Here's the full debug message from Firefox:
Error cargando URI: Could not load the source for blob:https://192.168.0.154/f48cbb41-9ec6-467b-ac78-e683b4216b0e.
- [Exception... "Failed to open input source 'file:////192.168.0.154/f48cbb41-9ec6-467b-ac78-e683b4216b0e'" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/DevToolsUtils.js :: mainThreadFetch :: line 645" data: yes]
- Stack: mainThreadFetch@resource://devtools/shared/base-loader.js -> resource://devtools/shared/DevToolsUtils.js:645:5
- _getSourceText/<@resource://devtools/shared/base-loader.js -> resource://devtools/server/actors/source.js:410:27
Line: 645, column: 0
RodolfoEBDR (talk) 12:54, 24 July 2018 (UTC)
Content blocked by Chrome Security
After MediaWiki 1.33 upgrade, embedded box is displayed, but it is always empty. 82.5.14.66 (talk) 10:02, 8 July 2019 (UTC)
- I found that the pdf content appeared on another computer and subsequently realised that chrome was blocking the content because it would not run an "unsafe script". This probably happened because my wiki site had no security certificate. 82.5.14.66 (talk) 07:27, 9 July 2019 (UTC)
Add the following code at the bottom of your LocalSettings.php:
Where do I find my LocalSettings.php? 68.36.79.230 (talk) 15:15, 2 March 2020 (UTC)
- Found it.
68.36.79.230 (talk) 15:42, 2 March 2020 (UTC)
Use of "Parser::disableCache" was deprecated in MediaWiki 1.28.
RESOLVED | |
A preliminary? working fork of the extension is mentioned in this thread. |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Any idea on how to remove this error across the top of the page? The pdf is embedding perfectly yet this error appears?
Use of Parser::disableCache was deprecated in MediaWiki 1.28. [Called from PDFEmbed::generateTag in xxxxxxxxxxxxxxxxxxxx PDFEmbed\PDFEmbed.hooks.php at line 39] in xxxxxxxxxxxxxxxxx xxxxdebug\MWDebug.php
Any help appreciated Equalze (talk) 13:07, 25 March 2020 (UTC)
- Probably you are not using the version of PDFEmbed matching the version of MediaWiki you are using, meaning that if you upgrade MediaWiki you also have to upgrade the extensions.
- Probably you also have
$wgShowExceptionDetails = true;
somewhere in your "LocalSettings.php" file. You should change this to false if your wiki is live. [[kgh]] (talk) 16:40, 25 March 2020 (UTC) - @Kghbln Version has been updated to 2.0.2. the most up to date, MW Version is 1.34.0 Equalze (talk) 17:14, 26 March 2020 (UTC)
- Thanks for reporting back! So it appears that this issue is still part of the code base. I have created an issue report for the extension's developer. [[kgh]] (talk) 18:19, 26 March 2020 (UTC)
- MediaWiki 1.35 removed disableCache, so this is now a fatal exception. I've added this info and suggested code changes to the issue report that @Kghbin created. Gracionsoft (talk) 21:30, 4 October 2020 (UTC)
- So that others may find this, the error message was: "Error from line 39 of /var/www/html/w/extensions/PDFEmbed/PDFEmbed.hooks.php: Call to undefined method Parser::disableCache()". Path may, of course, be different.
- In mediawiki version 1.34.4, the file includes/parser/Parser.php had a suggestion in the comments to the function disableCache() to "use getOutput()->updateCacheExpiry()". The function disableCache itself has the line "$this->mOutput->updateCacheExpiry( 0 ); // new style, for consistency" at the end.
- I tried, therefore, changing the line "$parser->disableCache();" to "$parser->getOutput()->updateCacheExpiry(0);" in extensions/PDFEmbed/PDFEmbed.hooks.php. This seems to work, but I can't vouch for it's utility or safety. VOIstri (talk) 18:14, 10 October 2020 (UTC)
Using page number as variable in template
RESOLVED | |
Use #tag parser function |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Hey, need some assistance.
I have everything working well, except for one thing.
I have a page I'm trying to allow users to display PDFs on, and some of those may need to have other PDFs displayed.
So I'm using a {{{pagenum}}} to try to pass the provided page number through. I know it's pulling the number correctly because I can display it by itself elsewhere on the page. But it's not parsing in <pdf page={{{pagenum}}}"File:filename.pdf</pdf>
Any ideas or thoughts? ElmerG99 (talk) 01:14, 30 March 2020 (UTC)
- You should do something like:
{{#tag:pdf |File:filename.pdf |page={{{pagenum}}} }}
- See here for more info. WikiTeq (talk) 14:41, 30 March 2020 (UTC)
- Hrm.
- So that just gave me a URL or Filepath does not exist. error now. I'm using a {{{filename}}} call for the file as FIle:{{{filename}}}. WHen it's in the template, even with File:Actual_File_Here.pdf it throws an error. If I put it into a test wiki with hard parameters it displays fine.
- EDIT: Aha, it won't take a partial. I have to pass the full FIle:File_Name_Here.pdf, I can't just pass the filename.pdf.
- That's awesome, thank you so much. ElmerG99 (talk) 22:38, 30 March 2020 (UTC)
Error ShellDisabledError on pdf upload
I had this error in 1.33 while uploadinf a pdf. Every pdf.
I do not understand why, but, looking for help in talks, I remembered I activate PDFHandler in the Wiki installation.
Disabled the default extension and now everything works fine.
So, PDFEmbed and PDFHandler does not works fine togheter. 2.239.139.214 (talk) 00:07, 8 May 2020 (UTC)
- It worked for me too on MW 1.31.
- Thank you so much. 93.41.255.164 (talk) 10:54, 30 December 2020 (UTC)
Which browsers is it broken on
The page says that it only works on some browsers from Mediawiki 1.30 onwards. Could we have a list of which browsers work, and which don't now. Vicarage (talk) 10:08, 25 July 2020 (UTC)
MW 1.35 Call to undefined method Parser::disableCache()
PDFEmbed/PDFEmbed.hooks.php: Call to undefined method Parser::disableCache() Seppl2013 (talk) 14:04, 11 October 2020 (UTC)
- I created a (hopefully) working fix at https://github.com/WolfgangFahl/PDFEmbed and would love to share it we a pull request and get feeback on it. See also https://gitlab.com/hydrawiki/extensions/PDFEmbed/-/issues/19 Seppl2013 (talk) 10:11, 12 October 2020 (UTC)
- Thanks for working on this and providing a way out. [[kgh]] (talk) 16:10, 30 October 2020 (UTC)
- Hi, @Seppl2013, thank you for the solution. In order to do some combability with the old synaxis,
<pdf>File:Name-of-the-file.pdf</pdf>
, I've made an additional fix in my local copy ofPDFEmbed.hooks.php
in this way:Spas.Z.Spasov (talk) 11:58, 5 November 2020 (UTC)$filename = $re[1]; if (count($re) == 3) { $page = $re[2]; } // the next lines are new $ns_media_wiki_lang = MediaWiki\MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNsText( NS_MEDIA ); $ns_file_wiki_lang = MediaWiki\MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNsText( NS_FILE ); $ns_media_lang_en = MediaWiki\MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' )->getFormattedNsText( NS_MEDIA ); $ns_file_lang_en = MediaWiki\MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' )->getFormattedNsText( NS_FILE ); $filename = preg_replace("/^($ns_media_wiki_lang|$ns_file_wiki_lang|$ns_media_lang_en|$ns_file_lang_en):/", '', $filename);
- FYI, I received a "File does not exist error" using Seppl2013's clone and it worked again after introducing Spas.Z.Spasov's changes. Thanks to you both! Andreas Wachowski (talk) 17:00, 6 November 2020 (UTC)
- see https://github.com/WolfgangFahl/PDFEmbed/issues/3 for the fix Seppl2013 (talk) 09:38, 13 November 2020 (UTC)
Error in MW1.35
RESOLVED | |
A preliminary? working fork of the extension is mentioned in this thread. |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
The extension Do not work on MW 1.35, it can not be saved or be previewd. It gives a report says, Caught exception of type error. The same codes works on MW 1.33.1
PDFembed version is 2.03.
Thanks! 2409:8A1E:84DD:AB0:40B6:2038:4D8E:6DB8 (talk) 15:25, 30 October 2020 (UTC)
MW 1_35 [X8eQyvnuCLpleT1MwUtyYgAAOQk] Exception caught: Call to undefined method Parser::disableCache()
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Now registered but doesn't work. Goodman Andrew (talk) 12:45, 2 December 2020 (UTC)
I got 'Internal Error'
I had this error in 1.35.1:
'Internal Error [1e3bd7042d4fdba8255c57a6] 2021-03-30 19:32:36: Fatal exception of type "Error" '
How can I run properly this plugin? 46.196.156.167 (talk) 19:35, 30 March 2021 (UTC)
Internal Error
Internal error
[cd8dca3e4334fb046fddfec9] 2021-03-30 20:54:25: Fatal exception of type "Error"
I am getting the following error when trying to use PDFEmbed v2.02 on 1.35.1 64.140.229.250 (talk) 20:58, 30 March 2021 (UTC)
- I have same problem with the same versions. Disabling PdfHandler didn't resolve the issue. 149.135.47.233 (talk) 03:04, 31 March 2021 (UTC)
- Same problem here: 2021-03-31 03:38:08: Fatal exception of type "Error"
- Same versions. 103.108.94.8 (talk) 04:03, 31 March 2021 (UTC)
- Same Error here on any page that includes <pdf>File:Example.pdf</pdf> or any version of it (eg with height) the page won't even save if this is on it.
- Just upgraded to version 1.35.1 200.25.6.85 (talk) 04:34, 31 March 2021 (UTC)
- Hi,
- I solve this issue by this fork
- https://github.com/WolfgangFahl/PDFEmbed
- You can try. Lambdacoresw (talk) 17:05, 31 March 2021 (UTC)
- Yes this worked for me as well! 64.140.229.250 (talk) 15:35, 2 April 2021 (UTC)
- it worked for me too, thanks ! Yannick Bravo (talk) 03:42, 14 April 2021 (UTC)
- Worked for me too, thanks! Gerges massoud (talk) 14:12, 6 September 2021 (UTC)
- Thanks Lambdacoresw! That worked!
- I had to re-save the pages with the embed code in, otherwise I got a permission error. After that, all good! 149.135.47.233 (talk) 23:06, 31 March 2021 (UTC)
- Downloaded the fork and didn't fix it for me argh. On Mediawiki version 1.31.16. It seems maybe I need to upgrade to a newer Mediawiki but doing this seems very complex. Is there any other fix? Chrisgmay16 (talk) 06:26, 8 September 2022 (UTC)
Pdf Document does not load into viewer.
RESOLVED | |
Resolved by updating PDFEmbed extension. |
The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
The pdf document viewer is displayed, but the document itself is not loaded into the viewer or displayed under all but the first tab on a wiki page. For example, when using the either the Header Tabs or Tabs extension, the document viewer is displayed and the document loads under the first tab only. In all subsequent tabs, only the viewer is displayed. In this situation, if the viewer is configured other than default (e.g., change page <pdf page=2>), the viewer is blank and still indicates page 1/1. By clicking the resize button on the viewer, the document then loads and displays correctly.
Is there a way to force the viewer to load and display the document when the markup code (i.e., <pdf></pdf>) is processed? Zed4242 (talk) 15:45, 7 May 2021 (UTC)
Mediawiki 1.37 Update
I have get the extension working for Mediawiki 1.37 by replacing line no 160 of extensions/PDFEmbed/PDFEmbed.hooks.php from
$pdfFile =wfFindFile($filename);
to
$pdfFile = MediaWikiServices::getInstance()->getRepoGroup()->findFile($filename); 182.189.202.95 (talk) 14:20, 22 February 2022 (UTC)
- I think,
- $pdfFile = MediaWiki\MediaWikiServices::getInstance()->getRepoGroup()->findFile($filename);
- is the right solution. It works on my MediaWiki.
- Greetings
- Meinolf Stra2senBahn (talk) 16:13, 28 February 2022 (UTC)
Fatal exception of type "Error"
On Mediawiki 1.31.16. I've tried redownloading the extension using the fork as someone mentioned in a previous post. Is there anything else I can do besides upgrade my Mediawiki? Because I don't think I can do that. Chrisgmay16 (talk) 06:29, 8 September 2022 (UTC)
Error with MW 1:34.2 undefined method: getUserFactory
Just installed PDFEmbed 3.0.0 on a MediWiki 1:34.2 and php 7.4 and got the following error. I assumed PDFEmbed 3.0.0 includes any previous items fixed in this discussion area?
[Y20UWoSC-V0pUiyM3altfQAAABQ] /wiki/xxxxxxxxxx Error from line 115 of /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/extensions/PDFEmbed/PDFEmbed.hooks.php: Call to undefined method MediaWiki\MediaWikiServices::getUserFactory()
Backtrace:
#0 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/parser/Parser.php(4293): PDFEmbed::generateTag(string, array, Parser, PPFrame_Hash)
#1 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/parser/PPFrame_Hash.php(328): Parser->extensionSubstitution(array, PPFrame_Hash)
#2 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/parser/Parser.php(3330): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#3 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/parser/Parser.php(1489): Parser->replaceVariables(string)
#4 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/parser/Parser.php(593): Parser->internalParse(string)
#5 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/content/WikitextContent.php(368): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#6 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/content/AbstractContent.php(555): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#7 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/Revision/RenderedRevision.php(264): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#8 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#9 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#10 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#11 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#12 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#13 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/poolcounter/PoolWorkArticleView.php(196): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#14 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/poolcounter/PoolCounterWork.php(125): PoolWorkArticleView->doWork()
#15 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/page/Article.php(791): PoolCounterWork->execute()
#16 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/actions/ViewAction.php(63): Article->view()
#17 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/MediaWiki.php(511): ViewAction->show()
#18 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/MediaWiki.php(302): MediaWiki->performAction(Article, Title)
#19 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/MediaWiki.php(900): MediaWiki->performRequest()
#20 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/includes/MediaWiki.php(527): MediaWiki->main()
#21 /var/www/vhosts/xxxxx.xxx/httpdocs/mediawiki/index.php(44): MediaWiki->run()
#22 {main} Robinhair2441 (talk) 22:11, 10 November 2022 (UTC)
MediaWiki 1.40
Will you all make a version compatible with MediaWiki 1.4? I have upgraded and can no longer use this extension. 155.190.21.26 (talk) 13:13, 21 August 2023 (UTC)
Incompatible with MW 1.39.4 too
It can be installed but instead of the file, only the black borders are shown, no file is displayed. iframe with https link is generated so it is some conflict with mediawiki core. During opening the page the file is embedded (iframed) on, it asks for saving the file which is highly undesirable behaviour. Pspviwki (talk) 13:26, 13 September 2023 (UTC)
Display a specific revision
Hi,
is there a way to embed a specific reversion of the pdf file?
Like <pdf height="800" width="1250">File:myfile.pdf?oldid=12345</pdf>
Swenp (talk) 08:40, 5 December 2024 (UTC)