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.

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 ?

Reply to "Users unable to embed PDF"
212.83.194.34 (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(

           'iframe',

           [

               //'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

2
Daniel.Humphrey (talkcontribs)

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

RodolfoEBDR (talkcontribs)

Any chances to review this?

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

Blank Frame and no PDF displaying

5
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: https://imgur.com/dZjX8Fw

194.237.95.149 (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 '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."

RodolfoEBDR (talkcontribs)

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

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

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: https://stackoverflow.com/a/12974315/498730 for more info that I have found about this problem.

Reply to "IE 11 Compatibility problem"
182.72.144.54 (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.

83.247.136.44 (talkcontribs)

I have the same error,

Since 3 months before it works fine, ..

Can you help us?

Thank .

guindelo

Guindelo (talkcontribs)

I have the same error,

Since 3 months before it works fine, ..

Can you help us?

Thank .

guindelo

Reply to "embed pdf error"

PDFEmbed.php is missing in Dowload Version 2.0

5
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.

137.191.228.226 (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.

Thanks,

Keith

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 MediaWiki.org to indicate that extension registration is required.

Is the version on Git correct

1
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

1
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.