简体   繁体   English

由TCPDF生成的pdf中的png图像显示..黑色背景

[英]png image in pdf generated by TCPDF shows .. black background

I am developing a pdf using TCPDF . 我正在使用TCPDF开发pdf。 But when I try to print a PNG image the background of the image in pdf looks dark .. 但是当我尝试打印PNG图像时,pdf图像的背景看起来很暗..

Please help me .. If any one know about its solution 请帮助我..如果有人知道它的解决方案

Regards 问候

It depends on the transparency of the PNG. 这取决于PNG的透明度。 Possibly you are using alpha transparency in your png so please convert it to index transparency. 可能是您在png中使用了alpha透明度,因此请将其转换为索引透明度。

TCPDF uses GD or ImageMagick (via Imagick) for image manipulation. TCPDF使用GD或ImageMagick(通过Imagick)进行图像处理。 There is also built-in image manipulation. 还内置了图像处理功能。 So it's a complex topic. 所以这是一个复杂的话题。

I had a transparency issue using TCPDF with ImageMagick on Debian 9. As you described the transparent background was replaced by black color in pdf generated. 我在Debian 9上将TCPDF与ImageMagick一起使用时出现了透明性问题。正如您所描述的,透明背景已替换为生成的pdf中的黑色。 I could fix the issue by installing imagemagick-common package additionally to imagemagick-6.q16 and php-imagick . 我可以通过在imagemagick-6.q16php-imagick之外另外安装imagemagick-common软件包来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM