Jump to content

Extension talk:PDFEmbed

About this board

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"

Incompatible with MW 1.39.4 too

1
Pspviwki (talkcontribs)

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.

Reply to "Incompatible with MW 1.39.4 too"
155.190.21.26 (talkcontribs)

Will you all make a version compatible with MediaWiki 1.4? I have upgraded and can no longer use this extension.

Reply to "MediaWiki 1.40"

Error with MW 1:34.2 undefined method: getUserFactory

1
Robinhair2441 (talkcontribs)

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}

Reply to "Error with MW 1:34.2 undefined method: getUserFactory"

Fatal exception of type "Error"

1
Chrisgmay16 (talkcontribs)

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.

Reply to "Fatal exception of type "Error""
64.140.229.250 (talkcontribs)

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

149.135.47.233 (talkcontribs)

I have same problem with the same versions. Disabling PdfHandler didn't resolve the issue.

103.108.94.8 (talkcontribs)

Same problem here: 2021-03-31 03:38:08: Fatal exception of type "Error"

Same versions.

200.25.6.85 (talkcontribs)

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

Lambdacoresw (talkcontribs)
149.135.47.233 (talkcontribs)

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!

Chrisgmay16 (talkcontribs)

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?

Reply to "Internal Error"
182.189.202.95 (talkcontribs)

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);

Stra2senBahn (talkcontribs)

I think,

$pdfFile = MediaWiki\MediaWikiServices::getInstance()->getRepoGroup()->findFile($filename);

is the right solution. It works on my MediaWiki.


Greetings

Meinolf

Reply to "Mediawiki 1.37 Update"
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

Pooja2425 (talkcontribs)

Same issue for me also, Pls suggest any other extension or any fixed build.

Reply to "embed pdf error"

Pdf Document does not load into viewer.

1
Summary by Zed4242

Resolved by updating PDFEmbed extension.

Zed4242 (talkcontribs)

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?

I got 'Internal Error'

1
46.196.156.167 (talkcontribs)

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?

Reply to "I got 'Internal Error'"