[英]Not transparent background after inserting png on pdf
我正在尝试在Ubuntu Server上使用Imagick在pdf文件上添加png图像。
$background = imagecolorallocate($signature_place, 255, 255, 255);
imagefill($signature_place, 0, 0 , $background);
imagecolortransparent($signature_place, $background);
但是背景为白色。
有趣的事实是它可以在Windows上正常工作。
我正在使用:
我真的不明白错误可能在哪里。
有人遇到这样的问题吗? 我在哪里可以找到错误?
这就是我使用的PNG
$im = imagecreatefrompng($this->source);
imagealphablending($newImg, false);
imagesavealpha($newImg, true);
$transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127);
imagefilledrectangle($newImg, 0, 0, $newWidth, $newHeight, $transparent);
imagecopyresampled($newImg, $im, 0, 0, 0, 0, $newWidth, $newHeight, $this->srcWidth, $this->srcHeight);
imagepng($newImg, $this->destin);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.