Closed dev-panpic closed 1 year ago
I found a way to fix it.
public function getImageData($pathToImage)
{
$imagick = new \Imagick();
$imagick->setResolution($this->resolution, $this->resolution);
$imagick->readImage(sprintf('%s[%s]', $this->pdfFile, $this->page - 1));
// Remove alpha channel here
$imagick->setImageBackgroundColor(new \ImagickPixel('WHITE'));
$imagick->setImageAlphaChannel(\Imagick::ALPHACHANNEL_REMOVE);
$imagick->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
$imagick->setFormat($this->determineOutputFormat($pathToImage));
return $imagick;
}
This doesn't fix it for me unfortunately:
Source pdf: 20936IIED.pdf
This patch fixes the issue: https://www.drupal.org/files/issues/2021-12-03/remote-pdf-overlap-3221786-8.patch
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
I converted from a pdf file to an image, but the image has a black background color How do I fixed?