not a PNG file in FPDF

2019-06-09 21:46发布

问题:

In FPDF, I am using this function to print image on pdf file.

$this->Image("./media/logo_291.png",1,1,$image_size);

It's working fine in .jpg file. But not in .png. I checked on my server. The file is already there. When I change entire image with .jpg extension, then it works but not for .png format file.

ERROR

FPDF error: Not a PNG file: ./media/logo_291.png

EDIT

I can see the .png file in my browser. It's just problem with FPDF.

标签: php fpdf