I was stuck in this issue too
this is what worked with me
you can't put the base URL dynamically
src="https://test.com/path/{{$clinic->logo}}"
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys
I have to display image on PDF File via DOMPDF.
All I get so far is "Image not found or type unknown"
Based on docs and research i have used those 3 methods in my Controller. None of those gives the correct result
// 1 $pdf = PDF::loadView('frontview.PDF.PDFReport',array('enable_remote' => false,'name' => $name,'votes'=> $votes,'post_id' => $post_id))->setPaper('a4', 'portrait')->setOptions([
// 'tempDir' => public_path(),
// 'chroot' => '/public/storage/e-signatures/',
// ]);;
// 2 return PDF::setOptions(['isHtml5ParserEnabled' => true, 'isRemoteEnabled' => true])
// ->loadView('frontview.PDF.PDFReport',array('name' => $name,'votes'=> $votes,'post_id' => $post_id))->setPaper('a4', 'portrait')
// ->stream('VoteReport.pdf');
//
//3
$pdf = PDF::loadView('frontview.PDF.PDFReport',array('name' => $name,'votes'=> $votes,'post_id' => $post_id))->setPaper('a4', 'portrait');
return $pdf->stream((Carbon::now()->format('Ymd').'VoteReport.pdf'));
}
}
I have tried all these lines in my view.blade.
@php $picture = asset('storage/e-signatures'.$user->docusign); @endphp
{{--<img src="{{ $user->docusign }}">--}}
{{--<img src="storage/{{ $user->docusign }}" width="70">--}}
<img src="{{ base_path() }}/storage/e-signatures.{{$user->docusign}}" class="pic_preview" width="50px" height="50px">
{{--<img src="{{ $picture }}" class="pic_preview" width="50px" height="50px">--}}
{{--<img src="{{asset('storage/e-signatures'.$user->docusign)}}--}}
{{--<img src="{{public_path('storage/e-signatures/'.$votes->docusign)}} ">--}}
{{--C:\xampp\Laravel\blog\public\storage/e-signatures/5f71a5e38e91f.png--}}
{{--C:\xampp\Laravel\blog\public/storage/app/public/e-signatures/5f6a05344a52d.png
{{--http://localhost/storage/app/public/pic/user_pic/82ac9404bdb74d0ad980a30faadeab22cd41b38d.jpg
/storage/pic/user_pic/--}}
I am saving the image like this:
$folderPath = public_path('storage/e-signatures/');
$image_parts = explode(";base64,", $request->signed);
$image_type_aux = explode("image/", $image_parts[0]);
$image_type = $image_type_aux[1];
$image_base64 = base64_decode($image_parts[1]);
$signature = uniqid() . '.' . $image_type;
$file = $folderPath . $signature;
file_put_contents($file, $image_base64);
$signed->docusign = $signature;
$signed->save();
return back()->with('message', '');
{{$user->docusign}} gets me the the exact match of the field that i want.
I can also access it relative path and absolute path.
But i cant NEVER display it on PDF
Please HELP 3-days on that already.
Please or to participate in this conversation.