There are few things that can cause this error to happen, but I found this issue and the solution offer by TigselemaAlex could help you.
Feb 28, 2025
3
Level 63
laravel-dompdf - Malformed UTF-8 characters, possibly incorrectly encoded
Hello,
I'm regularly using laravel-dompdf, but it's the first time that I get this error.
Malformed UTF-8 characters, possibly incorrectly encoded
I have tried with loading the view, with loading HTML, ... I always get this error.
Here is my code.
public function export()
{
$selectedDate = Carbon::create($this->selectedYear, $this->selectedMonth)->format('Ym');
$name = 'Report - '.$selectedDate.'.pdf';
return Pdf::
loadView('pdf.report', [
'month' => $this->months[$this->selectedMonth],
'year' => $this->selectedYear,
'reports' => $this->reports,
])
->setPaper('a4', 'landscape')
->stream();
}
What am I doing wrong ?
Thanks for your help.
V
Level 16
1 like
Please or to participate in this conversation.