6
votes

Here is the HTML just before $dompdf->render() and $dompdf->output() are called:

<img src="http://www.example.com/images/Logo.png" />

All other invoices display the image fine when viewing in the browser, or printing it, or emailing it as HTML. When I click 'Generate PDF' inside of our application, it renders the invoice in PDF, except the logo is missing. I have put a debugging line in to email me the raw HTML it sends to the render(), and it looks fine to me.

Does anyone have any idea why dompdf won't display this image?

2
Which version of DOMPDF are you using? I can't remember the exact limitations, but I believe 0.5.1 had issues with alpha transparency in PNG. This was mentioned here: drupal.org/node/558170#comment-1981550 - BrianS
WOW THANKS! Thats what it was. Ugh! - Kevin

2 Answers

14
votes

An idea: if you are providing full URI to the image it is treated as external, so defined costant DOMPDF_ENABLE_REMOTE must be set to true.

2
votes

Looks like you have to pass the server path and not the server url in the src param

http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/