Lumnezia
Lumnezia

Reputation: 796

DOMPDF displaying pictures, but wrong

I'm using DOMPDF to generate several documents, and in the top left is an image that looks like this:

How the image should look like

But whenever I generate the PDF there is a very small chance (let's say about 10%) that the image will look like this:

Image with error

I have no idea why this happens. It doesn't happen to any other images in the document.

When I move the image a few pixles up or down, the white line moves as well, so it's not like there is a hidden element or something placed over the image.

Is this a known DOMPDF problem ?

Upvotes: 1

Views: 1267

Answers (1)

Lumnezia
Lumnezia

Reputation: 796

It appears that this is caused by imagick. It can be disabled as follows:

Add the following line to "dompdf_config.custom.inc.php":

define("DOMPDF_ENABLE_IMAGICK", false);

And change line 4324 of "class.pdf.php" from:

elseif (extension_loaded("imagick")) {

to:

elseif (extension_loaded("imagick") && DOMPDF_ENABLE_IMAGICK) {

This solution worked for me

I found it here: https://github.com/dompdf/dompdf/issues/432

Thanks to BrianS

Upvotes: 2

Related Questions