Jump to content

Topic on Extension talk:Mpdf

MPDF is not giving image with wiki 1.35

9
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)
MySQL 8
OS LINUX


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


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 https://extdist.wmflabs.org/dist/extensions/Mpdf-REL1_35-94bd27c.tar.gz

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

$wgMpdfSimpleOutput=true;

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

/ttfontdata/

/tmp/

/graph_cache/

http://localhost/wiki135/index.php/Main_Page?title=Main_Page&action=mpdf



Please help me to fix this.


Thanks

Apatha11 (talkcontribs)

Waiting for response.

AKlapper (WMF) (talkcontribs)
Apatha11 (talkcontribs)

Could you please let me know that which steps are pending. Please suggest if you know.. I have done all steps which is mentioned in the mpdf document.

In mpdf document they asked to add in composer.local.json-sample and add require_once in localsettings.Php. I did what mentioned in given mpdf doc.

https://m.mediawiki.org/wiki/Extension:Mpdf

AKlapper (WMF) (talkcontribs)

You state "In mpdf document they asked to add in composer.local.json-sample": No. That is not true. The page that you linked really does not say that.

Apatha11 (talkcontribs)

Thanks for your time !! Please check the doc, it’s mentioned there , Could you please help me to fix this rather than discus about above thing. . Please Suggest how can I fix this or correct me where I have done wrong .

Apatha11 (talkcontribs)
Please check here
AKlapper (WMF) (talkcontribs)

As your screenshot clearly shows, "composer.local.json-sample" it is NOT mentioned there, which I have now written three times. This conversation is not a good use of my time as you unfortunately do not seem to carefaully read and follow the docs, so you run into issues.

Apatha11 (talkcontribs)

HI Please Try to understand, They are using composer.local.json on the root as well we have composer.local.json-sample file on the root, our file name is not same in root of wiki.

You want me to rename composer.local.json-sample to composer.local.json? then It will work according to you? or I can include this line in composer.json ("extensions/Mpdf/composer.json")


Kindly clear this.

One more thing, please have look at the below info regarding our application.

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

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.


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

Reply to "MPDF is not giving image with wiki 1.35"