Php – TCPDF image resize

image resizingpdfPHPtcpdf

I want to crate pdf with the leatest TCPDF.
I have an LC6 landscape document (152mm × 109mm). I put an image to the page, and set the image parameters like this:

$pdf->Image($image, 0, 0, 152, 0, 'PNG', '', '', true, 300);

The pdf file is empty. But, when I change 152 to 151, the image is appear in the pdf file, but smaller then the document.
Why disappear the image when it has enough space?
My picture is 1795×1287px but its doesn't matter because I want to resize it.

Update:
This problem doesn't occur with every picture, in other picture is appear correctly in pdf. The two images has same dpi and same resolution. Could be the source of problem the transparency?

Best Answer

Problem is solved.
The cache folder must be writeable. Unfortunately I have not found this information in the documentation, I have found it in the source code, in some images parser method's comment.

Related Topic