On my server pdf generated via dompdf was not displaying images. Because they are remote url images.(local images are working fine) then I come to know that it needs some se
I think you could add this
private function change_url_image($data, $url) {
$str = $url; //for example "http://localhost/yoursite/";
$str2 = str_replace($str, "", $data);
return $str2;
}
to change url for image
I had the same issue after doing a lot of R&D finally got the solutions.First you need to get the options of dompdf then set isRemoteEnabled
with true.
$options = $dompdf->getOptions();
$options->set(array('isRemoteEnabled' => true));
$dompdf->setOptions($options);
There are two things to take care of.
If using image from same server then use full directory path e.g.
/var/www/html/project_folder/images/logo.jpg
List item Use JPEG
image instead of png
or other types.
I used this line of code
<img src="{{ url('/frontened/images/jeevan-green-logo.png') }}" >
It's working fine. Thanks.
Try use full directory path with .jpg image
I realized that jpg images appear when you host your files remotely.