0

I am using Laravel Dompdf to generate PDF. Use Kalpurush font for Bangla text. Everything working well but text showing mismatch into PDF view. Lets example:Text should be আমি comes out like আ ম ি . I don't know how can solve this problem. Already used UTF-8 charset. Here is my code sample

$pdf = PDF::setOptions(['dpi' => 150, 'defaultFont' => 'Kalpurush'])->loadView('text.download', compact('data'));

<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <style>

       @font-face {
            font-family: "Kalpurush";
            src: url({{ storage_path('fonts/Kalpurush.ttf') }}) format('truetype');
        }

        body { font-family: "Kalpurush", DejaVu Sans;}

  </style>

Have anyone face this type of problem. Please give me guideline or any solution to solve this Bangla font problem for Lavavel Dompdf.

raihan
  • 2,225
  • 4
  • 14
  • 19
  • all these libraries have problem handling compound letters, see I have given a similar answer [dompdf problem with displaying nepali character](https://stackoverflow.com/questions/63324087/dompdf-problem-with-displaying-nepali-character) – bhucho Nov 22 '20 at 15:06
  • though it is a nice thing that yours has reached upto this, which version of dompdf are you using – bhucho Nov 22 '20 at 15:07
  • @blucho Thanks for your comments. I am using "barryvdh/laravel-dompdf": "^0.8.5". If you have any solution then please help me. – raihan Nov 23 '20 at 04:59
  • what are you using as a frontend tool , jquery, vuejs etc, also please post the static version of your html here if possible – bhucho Nov 23 '20 at 08:03
  • i am using raw html. Output show as Lets example:Text should be আমি comes out like আ ম ি – raihan Nov 24 '20 at 04:44

0 Answers0