kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

Unable to export picture in pdf after upgrade. #116

Closed m00nh3ck closed 3 years ago

m00nh3ck commented 3 years ago

Since upgrading to latest version from I am not able to have picture displayed in the PDF.

It works fine on HTML but when exported the picture is missing.

Is there any know issues or this functionality has been removed ?

"name": "kartik-v/yii2-mpdf", "version": "v1.0.6",

"require": { "mpdf/mpdf": "~8.0" },

Pictures which should be emplemed

Html::img('/logo-red.gif');

Tried few thinkgs using @web direct link to picture etc.

'exportConfig' => [
'pdf' => [ // same as on the panel configuration Ref: http://demos.krajee.com/grid#default-export-config] 'showFooter' => false, 'mime' => 'application/pdf', 'filename' => $customer->company." - ".$invoice_ref,
'config' => [
'contentBefore' => $contentBefore, 'contentAfter' => $contentAfter, 'mode' => 'c', 'options' =>[ // 'showWatermarkImage' => [true], //'title' => $invoice_ref, //'subject' => Yii::t('kvgrid', $invoice_ref), //'keywords' => Yii::t('kvgrid', 'export, pdf') ], 'methods' => [ 'SetHeader' => [$heading], 'SetFooter' => [$footer],
// 'SetWatermarkImage' => ['logo-red.gif'],
],
], ],

m00nh3ck commented 3 years ago

Setting permission to 777 also didn't not fix this problem

image

m00nh3ck commented 3 years ago

The fix this is to decode image to base64 instead of using url.