Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

insight's avatar

Not showing image in DOM PDF generated PDF

Dear Friends, I try to access an image from assets folder in PDF created using DOM PDF. I tried many options but not working I tried as <img src="{{ public_path('assets/applicant_photo/KSRTC-10220231001.jfif') }}" width="85" height="95" > Image not found or type unknown in DOMPDF erro got . I tried this <img src="{{ base_path('public/assets/applicant_photo/KSRTC-10220231001.jfif') }}" width="85" height="95"> but not working ...Please advise

Thanks Anes P .A

0 likes
5 replies
insight's avatar

Dear Friends, I got solution, In controller passed the public html path as in code

 return PDF::setOptions(['isHtml5ParserEnabled' => true, 
           'isRemoteEnabled' => true,'chroot' => public_path()])
           ->loadView('admin/NotificationPdfView',$arrayP)->stream('Notification_PDF.pdf');

and in blade file as

<img src="{{ public_path('assets/images/itmiss.jpg') }}" width="85" height="85" class="center">

Thanks @vincent15000

1 like

Please or to participate in this conversation.