0
votes

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.

all these libraries have problem handling compound letters, see I have given a similar answer dompdf problem with displaying nepali character - bhucho
though it is a nice thing that yours has reached upto this, which version of dompdf are you using - bhucho
@blucho Thanks for your comments. I am using "barryvdh/laravel-dompdf": "^0.8.5". If you have any solution then please help me. - raihan
what are you using as a frontend tool , jquery, vuejs etc, also please post the static version of your html here if possible - bhucho
i am using raw html. Output show as Lets example:Text should be আমি comes out like আ ম ি - raihan