Jump to content

Topic on Extension talk:PDFEmbed

Users unable to embed PDF

14
Legaulph (talkcontribs)
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

Pisnaz (talkcontribs)

Are you using <pdf>File:FooBar.pdf</pdf> ?

I just had the same issue and am kicking myself for it now.

165.228.93.174 (talkcontribs)

Having the same issue as well any ideas

Pisnaz (talkcontribs)

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.

RockSheep (talkcontribs)

This should be said in the configuration section of the extension article. Thanks!

Legaulph (talkcontribs)

Yes that works for me as well

This post was hidden by Pisnaz (history)
209.159.235.12 (talkcontribs)

That worked great! now that that has a permission line I can get my users to see or embed. Thanks a bunch!

77.20.30.72 (talkcontribs)

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!

217.19.146.36 (talkcontribs)

Anyone on this problem ?

IMTS-TB (talkcontribs)

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

212.236.21.221 (talkcontribs)

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.

2001:1C05:480:AA00:E27B:D6A9:1279:1933 (talkcontribs)

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.

Polymath uk (talkcontribs)

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;

Reply to "Users unable to embed PDF"