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>
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>
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
Are you using <pdf>File:FooBar.pdf</pdf> ?
I just had the same issue and am kicking myself for it now.
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 |
Hope that helps. Also be careful as blanket permissions might cause issues.
That worked great! now that that has a permission line I can get my users to see or embed. Thanks a bunch!
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!
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
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.
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.
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;
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.
Will you all make a version compatible with MediaWiki 1.4? I have upgraded and can no longer use this extension.
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}
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.
[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
I have same problem with the same versions. Disabling PdfHandler didn't resolve the issue.
Same problem here: 2021-03-31 03:38:08: Fatal exception of type "Error"
Same versions.
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
Hi,
I solve this issue by this fork
https://github.com/WolfgangFahl/PDFEmbed
You can try.
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!
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?
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);
I think,
$pdfFile = MediaWiki\MediaWikiServices::getInstance()->getRepoGroup()->findFile($filename);
is the right solution. It works on my MediaWiki.
Greetings
Meinolf
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.
I have the same error,
Since 3 months before it works fine, ..
Can you help us?
Thank .
guindelo
I have the same error,
Since 3 months before it works fine, ..
Can you help us?
Thank .
guindelo
Same issue for me also, Pls suggest any other extension or any fixed build.
Resolved by updating PDFEmbed extension.
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?