Closed DBX12 closed 6 years ago
You may need to check and understand how image embedding in PDF output is handled by mPDF library. Note that PDF output and HTML output handling are entirely different. Unlike HTML, you cannot provide a image link to embed images in PDF - it typically must be a base64 encoded image data for embedding images.
Refer mPDF library docs for image processing. You can set $mpdf->showImageErrors
to true
to debug image processing errors.
I get same problem here. how to solve it? @kartik-v
i get same problem..
Folks as i mentioned you need to configure the mPDF extension library to achieve your needs. This issue is not related to this extension as it just wraps the mPDF library for use in yii2. If you have suggestions to.improve please open a new issue.
Prerequisites
master
branch of yii2-mpdf.Steps to reproduce the issue
See below
Expected behavior and actual behavior
When I follow those steps, I see... a "missing image" icon in the PDF
I was expecting... the QR code
Environment
Browsers
Operating System
Libraries
Isolating the problem
I'm using your PDF extension and the QR-Code extension from 2amigos. The issue I run into is the following: In my view
_pdf
I "include" the QR code by<img src="<?= Url::to(['route/qrcode','text'=>$model->qr_code_content]) ?>" />
In my Controller I have this functionThe Controller renders the view in the
actionPdf
In the PDF the QR code is displayed as "missing image" icon, if I uncomment the third line (
return $this->renderPartial(...
the page renders as normal HTML and the QR code is displayed correctly. I will also open an issue for the mpdf extension. Please look up the issue together with 2amigos, thx See also my comment on the issue in the 2amigos/yii2-qrcode-helper repo