sadasdadssad
sadasdadssad

Reputation: 105

Trouble Displaying Images in PDF using Laravel-Dompdf: File Not Found or Unknown Type Issue

I make app to create pdf. Problem is that pdf doesn't display the image. For example I tryed add that in 2 ways:

<img src="http://localhost/images/pages/page-1.jpg">
<img src="{{asset('/images/pages/page-1.jpg')}}">

Urls is correct becouse in normal view img is display correctly. But if I tryed generate pdf via laravel-dompdf, it display me the error that file is not found or type is unknown. Controller's method is very simple

$data = $request->all();
$pdf = Pdf::loadView('pdf.simplepdf.layout', compact('data'));
return $pdf->download('invoice.pdf');

Do you know where my problem is?

Upvotes: 1

Views: 29

Answers (0)

Related Questions