I'm trying to use mpdf and it works fine with text but when I try to add an image to my pdf file the page is infinitely loading and nothing happens. I just see the browser page. When I delete the image, it works fine again and pdf file is created and could be downloaded.
The path to the image is right, I checked on the other simple view page without mpdf. Here is current result that I see when add an image: (https://i.ibb.co/KyfmvpN/2019-07-16-23-39-14.png)
I will be glad for any help, please!
Here is the controller:
public function actionCreateMPDF()
{
$mpdf = new mPDF();
$mpdf->WriteHTML($this->renderPartial('mpdf'));
$mpdf->Output();
exit;
}
public function actionForceDownloadPdf()
{
$mpdf = new mPDF();
$mpdf->WriteHTML($this->renderPartial('mpdf'));
$mpdf->Output('MyPDF.pdf', 'D');
exit;
}
and the view file where I am creating my pdf mpdf.php:
<p>Hello</p>
<img src="/images/top.png">