Extension talk:PDFEmbed

About this board

Users unable to embed PDF

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 ?

IMTS-TB (talkcontribs)


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


You have to replace line 92 in the PDFEmbed.hooks.pdf file


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


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

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"

Error with MW 1:34.2 undefined method: getUserFactory

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


#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"

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

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

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

Same versions. (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) (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" (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);


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



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


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.

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

Error ShellDisabledError on pdf upload

2 (talkcontribs)

I had this error in 1.33 while uploadinf a pdf. Every pdf.

I do not understand why, but, looking for help in talks, I remembered I activate PDFHandler in the Wiki installation.

Disabled the default extension and now everything works fine.

So, PDFEmbed and PDFHandler does not works fine togheter. (talkcontribs)

It worked for me too on MW 1.31.

Thank you so much.

Reply to "Error ShellDisabledError on pdf upload"

MW 1_35 [X8eQyvnuCLpleT1MwUtyYgAAOQk] Exception caught: Call to undefined method Parser::disableCache()

Goodman Andrew (talkcontribs)

Now registered but doesn't work.

Return to "PDFEmbed" page.