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

Laracast13's avatar

Laravel DOMPDF UTF 8

Using DOMPDF, when generate pdf not English text showing ??????? How can I add UTF8 encoding ?

    public function getPDF($id)
    {    
         
        $invoice = Invoice::find($id); 
 
        $pdf = PDF::loadHTML('invoices.pdf', ['invoice' => $invoice] );
    
        return $pdf->download('file.pdf');
    }

in blade using


<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
0 likes
3 replies
s4muel's avatar
s4muel
Best Answer
Level 50

does your font support those non-english characters? try using DejaVu Sans and check if that works

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <style>
    * { font-family: DejaVu Sans !important; }
  </style>
</head>
3 likes

Please or to participate in this conversation.