我正在开展一个涉及 TCPDF 的项目。我已经使用它有一段时间了,但是在上次更新(6.0)之后,我的 PNG 图像确实被破坏了,尽管它的碎片在文档中仍然可见。
我使用 Image() 方法如下:
$pdf->图像($img, $x, $y, $twidth, $theight);
其中 $img 是源 URL,$x 和 $y 是位置,$twidth 和 $theight 是大小。 我测试过 GIF 和 JPG,效果很好。 PDF 上有一个 GIF 图片可以证明这一点。 PNG图像是VLC图标标志。
图片:
最佳答案
来自project site ,给有类似问题的用户:
Probably you have problems with PNG images with transparency that are handled in different way depending on the php-imagick or php-gd version used. Try to update php-imagick and disable php-gd
关于php - TCPDF:PNG 图像渲染不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15958239/