Topic on Project:Support desk

Jump to navigation Jump to search

Need to Install PDF Renderer Service which would support to embed the images.

Apatha11 (talkcontribs)

HI Support Desk,

Following are the installed software product version(s) those are being used in our RHEL7 server environment.

Installed software

Product Version
MediaWiki 1.35.1
PHP 7.4.15 (apache2handler)

We are looking for PDF Renderer Service which would support to embed the images in a Wiki page to a downloaded PDF file.

I have installed this Proton, but it did not work properly. As it's not well explained that how to integrate proton.

I followed this,

it did not work successfully.

Error: {"status":500,"type":"internal_error","title":"ReferenceError","detail":"preq is not defined","method":"GET","uri":"/"}


Kindly suggest how we can use this in our wiki 1.35.1.

Osnard (talkcontribs)
Apatha11 (talkcontribs)

Is this extension convert html to pdf with Image?

Osnard (talkcontribs)

Those extensions will export a wikipage into PDF.

Mpdf: Not sure, but I guess so. UEModulePDF: Yes.

Apatha11 (talkcontribs)

So UEModulePDF extension can download pdf with image?? Also there is no details for Extension:UEModulePDF on page that how to configure it.

Is this compatible with PHP 7.4?

I have tried MPDF and its downgliding pdf but not giving full path of image, can you please suggest where we can enable full path for image?

When I set as html not pdf so i saw the image url is not full (/wiki135/images/5/57/enterprise-wiki.jpg).

Can you please suggest from where its pickup up URL?

Malyacko (talkcontribs)
Osnard (talkcontribs)

Yes, UEModulePDF is compatible with PHP 7.4 and it will embed images in the PDF. Be aware that you will need to set up a Java Webserver as PDF renderer as well. See

You will probably need to set up the following extensions for UEModulePDF

Be aware that only LTS branches REL1_31 and REL1_35 are supported.

BlueSpice is also available as a MediaWiki distribution that bundels lots of extensions for the business usecase.

I am a little suprised that MPDF shouldn't be able to embed images. Are you sure you have set it up properly?

Apatha11 (talkcontribs)

Yes I have set it up properly as given in MPDF documentation. (Extension:Mpdf)

The path is not coming full in HTML. (/wiki135/images/5/57/enterprise-wiki.jpg).

From where I can change it, or it should be pick this automatically. Path should be like  :

https://localhost/wiki135/images/5/57/enterprise-wiki.jpg not /wiki135/images/5/57/enterprise-wiki.jpg

Error: Error parsing image file - image type not recognised, and not supported by GD imagecreate

Steps I have done:

  1. wget

2. tar -xzf Mpdf-REL1_35-94bd27c.tar.gz -C /data/www/html/wiki135/extensions

3. cd data/www/html/wiki135

#php maintenance/update.php

4. added("extensions/Mpdf/composer.json") in wiki135/composer.local.json-sample


"extra": {

"merge-plugin": {

"include": [

"extensions/Mpdf/composer.json"] } } }

5. in mpdf dir

#composer update --no-dev

6.added in LocalSettings.php

require_once( "$IP/extensions/Mpdf/vendor/autoload.php");

wfLoadExtension( 'Mpdf' );


7.Given 777 to all 3 dir (/data/www/html/wiki135/extensions/Mpdf/vendor/mpdf/mpdf)





Osnard (talkcontribs)

Have you set `$wgServer` or `$wgCanonicalServer` in you wikis configuration?

Have you set `$wgMpdfSimpleOutput = false`?

Apatha11 (talkcontribs)

When I set $wgMpdfSimpleOutput = true , its giving me PDF without image, but when I set it false its giving error:

/data/www/html/wiki135/extensions/Mpdf/vendor/mpdf/mpdf/classes/otl.php: Can't open file /data/www/html/wiki135/extensions/Mpdf/vendor/mpdf/mpdf/ttfontdata/dejavusanscondensed.GSUBGPOStables.dat

I cant see this file dejavusanscondensed.GSUBGPOStables.dat in /ttfontdata

I have already given 777 to Dir /Mpdf/vendor/mpdf/mpdf/ttfontdata/

$wgServer , Yes we have set our server name in Localsettings.php

Apatha11 (talkcontribs)

Please help me to fix this.

Osnard (talkcontribs)
Apatha11 (talkcontribs)

Hi As I can see there are many posts are pending, no one replied even. Could you please suggest to me something else, I need to fix this ASAP.

Kindly check my steps what I have done, if you think that something I missed please let me know.

Osnard (talkcontribs)

You may want to evaluate BlueSpice. It is available as Docker image. So you don't need to set up the PDF-Export manually.

Apatha11 (talkcontribs)

How to use BlueSpice, As there is no proper documentation that how to implement this in our application.

Osnard (talkcontribs)
Apatha11 (talkcontribs)

Is BlueSpice work as an extension like Mpdf or its separate CMS like a wiki. The new implementation will take time and I need to fix it by this week only. Kindly suggest working extension with PHP 7.4, if possible provide proper documentation for PDF export with BlueSpice.

One more thing, We are using LDAP+SSO login in our application Can you confirm that is MPDF compatible with these Protocol services.

Apatha11 (talkcontribs)

Hello Team,

Can you please confirm the above information?

Osnard (talkcontribs)

AFAIK MPdf is not affected in any way by the choice of the authentication method.

BlueSpice is a "distriution" of MediaWiki. You can think of it as an extension bundle, tailored to business needs. It has extensions for PDF export and LDAP/SSO. (talkcontribs)


I am facing issue when trying to export PDF.

Internal error

Jump to navigationJump to search

[YNA2dtUOfwBtUQ0sXxfrYQAAAAo] 2021-06-21 06:49:26: Fatal exception of type "MpdfException"

Apatha11 (talkcontribs)

But it's affecting our project, with LDAP+SSO it's not working and it's throwing us an unauthorized error in the image function. ( function _imageTypeFromString(&$data) )

$data is printing unauthorized error.

We have set 777 permission to the image folder.

We are already configured MPDF, if possible please provide any resource who can resolve this issue, In the above post, I have mentioned all steps that I have done in MPDF.

The same code is working fine where we are not using LDAP+SSO. Are you sure that MPDF works with the server which is secured with a password?

Osnard (talkcontribs)

No I am not sure. Apparently Mpdf actually tries to load the files via HTTP and therefore fails on the webserver authentication. One way to fix this could be to add a "bypass" of that authentication for any HTTP call coming from "localhost". If you are using Apache Webserver with "mod_auth_kerb" you can do this by "Require ip". Be aware that the requests by Mpdf will probably be "anonymous" (no user context). Therefore you may need to also adjust wiki permissions in such cases (e.g. setting "read" permission for "*" group). Such bypasses are always a little hacky.

Btw. you should not use "777" on your "images/" directory.

Apatha11 (talkcontribs)
Malyacko (talkcontribs)
Apatha11 (talkcontribs)

Is ElectronPDFService is compatible with wiki 1.35 for image in pdf and works with the server which is secured with a password like LDAP?

Well I have tried this and got error. Error:

The requested URL /api/rest_v1/page/pdf/Main_Page was not found on this server.

Apatha11 (talkcontribs)
Apatha11 (talkcontribs)

Can you please look in to this?

Apatha11 (talkcontribs)

Anyone will reply or need to post same query again?

Malyacko (talkcontribs)

If anyone knows an answer, they might reply. If nobody knows an answer, they will not reply. Do NOT post the same query again. Thanks.

Apatha11 (talkcontribs)

Hello team,

It's very disappointing that the wiki service team could not help me to resolve my one issue.

Also not mentioned proper documentation for any service. I have followed properly all documents but didn't work.

Electron PDF has very bad documentation, not clearly written how to implement, and whatever is written not working. (talkcontribs)

I experienced the same pain & frustration as Apath11 in terms of the broken images on the MediaWiki PDF Export feature. MediaWiki should provide the end users a solution ASAP. Otherwise the upgrade does not look good!!!

Apatha11 (talkcontribs)

I can help you in PDF... I have fixed this issue by my self only.

Osnard (talkcontribs)
Malyacko (talkcontribs)
Reply to "Need to Install PDF Renderer Service which would support to embed the images."