Open main menu

Extension talk:PDFEmbed

About this board

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. (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) (talkcontribs)

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


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! (talkcontribs)

Anyone on this problem ?

Reply to "Users unable to embed PDF" (talkcontribs)

Hi, is it possible to command the pdf to automatically fit to width?

RodolfoEBDR (talkcontribs)

Change the file PDFEmbed.hooks

static private function embed(File $file, $width, $height, $page) {

       return Html::rawElement(



               //'width' => $width,

               'width' => '100%',

               'height' => $height,

               'src' => $file->getFullUrl().'#page='.$page,

               'style' => 'max-width: 100%;'




Reply to "Automatically fit to width"

File Usage doesn't recognize usage of embedded pdf

Daniel.Humphrey (talkcontribs)


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:




RodolfoEBDR (talkcontribs)

Any chances to review this?

Reply to "File Usage doesn't recognize usage of embedded pdf"

Blank Frame and no PDF displaying

Summary by RodolfoEBDR

There was an error with the $wgServer parameter. After hardcoding the URL of the server, it worked.

RodolfoEBDR (talkcontribs)

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

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: (talkcontribs)

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 '' was loaded over HTTPS, but requested an insecure resource ''. This request has been blocked; the content must be served over HTTPS."

RodolfoEBDR (talkcontribs)

When inspecting debug mode in Firefox over the frame, it says:

Could not load the source for blob:

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

Here's the full debug message from Firefox:

Error cargando URI: Could not load the source for blob: [Exception... "Failed to open input source 'file:////'" 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

VOIstri (talkcontribs)

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: for more info that I have found about this problem.

Reply to "IE 11 Compatibility problem" (talkcontribs)

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. (talkcontribs)

I have the same error,

Since 3 months before it works fine, ..

Can you help us?

Thank .


Guindelo (talkcontribs)

I have the same error,

Since 3 months before it works fine, ..

Can you help us?

Thank .


Reply to "embed pdf error"

PDFEmbed.php is missing in Dowload Version 2.0

M art in (talkcontribs)

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?

Alexia E. Smith (talkcontribs)

I updated the installation instructions. You should switch over to extension registration style loading. (talkcontribs)

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.



Labrekke (talkcontribs)

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?

Alexia E. Smith (talkcontribs)

I updated the documentation on to indicate that extension registration is required.

Gharryh (talkcontribs)

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.

Strange while the file is here:

Whats wrong???

Reply to "Is the version on Git correct"
M art in (talkcontribs)

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

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!

How to disable the tool option to prefent non-users to download

HarryArends (talkcontribs)

Would it be possible to block unregistered users to download the pdf file.

Have a look here:

Reply to "How to disable the tool option to prefent non-users to download"
Return to "PDFEmbed" page.