DOMPDF image not showing

PHP Errors 1 Comment

DOMPDF image not showing

DOMPDF image not showing in your PHP script like the above screenshot.
Don’t worry, it’s just a small problem.

First of all get the latest version of the library from this Github link.

If DOMPDF image not showing when you download the PDF in your script then it means your DOMPDF is not allowing remote URLs.
In order to do this, just enable remote URL by setting isRemoteEnabled variable to true. Please have a look at the below mentioned code and you will understand it:

$options = new Options();
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf($options);

These 3 lines will resolve your issue of images not showing in your downloaded PDF and you will have all the images showing properly in your PDF.

Hope this helps.

Don’t forget to checkout tutorial of DOMPDF Example in PHP.

2.3 16 votes
Article Rating
Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments

still not resolve on server but resolve in localhost ,i also enabled extention=gd , and researched more about it but i don’t figure out what’s the main problem