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

user_hkcl's avatar

Laravel DOMPDF UTF-8 Issue

Laravel DOMPDF UTF-8 It is displaying character like ????? for Hindi Text. Here is My Code.

public function downloadPDF($id) {

$fscheme = \App\FarmerAppliedScheme::where('idAppliedScheme', '=', $id)->first();
$pdf = PDF::loadView('farmer.schemes.pdf', compact('fscheme'));
    return $pdf->stream('invoice.pdf');

}

Thanks all

0 likes
1 reply
campo's avatar

This is a known issue (font-related). You can add CSS to your template to change it to a font that properly displays these characters e.g.

body {
    font-family: DejaVu Sans;
}

See this github issue for more info.

Please or to participate in this conversation.