mPDF 5.7.1 - image displays as a broken [x]

后端 未结 11 1265
没有蜡笔的小新
没有蜡笔的小新 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:13

    I had the same problem with PNG images being displayed as [X] when to generate PDFs with mPDF.

    I added: $mpdf->showImageErrors = true;

    After: $mpdf = new Mpdf();

    and got the error message:

    GD library required for PNG image (alpha channel)#

    So after running apt-get install php5-gd generating a PDF with a PNG worked like a charm!

提交回复
热议问题