mPDF 5.7.1 - image displays as a broken [x]

后端 未结 11 1255
没有蜡笔的小新
没有蜡笔的小新 2020-12-29 05:59

I have a small issue with mPDF (version 5.7.1).

This code should generate PDF with image file:

 $mpdf = new mPDF();
 $html = \'

        
11条回答
  •  春和景丽
    2020-12-29 06:31

    You can try this:

    $mpdf->imageVars['myvariable'] = file_get_contents('alpha.png');
    

    or

    $html = '';
    $mpdf->WriteHTML($html);
    

    after there, you should do:

    $mpdf->Image('var:myvariable', 0, 0);
    

    read more about this in documentation: mPDF Load Image

提交回复
热议问题