mPDF not rendering images (mPDF error: IMAGE Error Could not find image file)

后端 未结 6 1355
执笔经年
执笔经年 2020-12-17 22:39

We are getting plagued with this which started in April on working server. Everything was fine with our application until the customer reported that PDFs were no longer dis

6条回答
  •  甜味超标
    2020-12-17 23:32

    I was running into the same issue. mPDF was running DOG SLOW and would end up just displaying a "Cannot find image file" error. After

    1. checking to make sure the image is actually there
    2. checking the permissions on the file
    3. checking all of the error logs on the server
    4. combing through the documentation on mPDF

    I found that the image file in question was corrupted somehow. I downloaded the image to my local computer, opened it up with an image editor (Paint.NET in this case), re-saved it as a .gif file and uploaded it to the server again. That seemed to fix it. Your mileage my vary.

    Also, for what its worth, I had to use images/image.gif instead of the file path /images/image.gif.

提交回复
热议问题