How to use bangla font when Generating pdf using Mpdf (Laravel) [closed]

I am trying to write Bengoli in my pdf which i am generating by MPDF library.

$mpdf = new MpdfMpdf([

            
            'margin_top'=>10,
            'margin_buttom'=>10,


        ]);

there is no errors , external fonts which i am trying to use for Bengoli is not effecting my content, I have both english and Bengoli content in same page so when i use other fonts or external fonts i get ?????????? [][[][][][][][], English content is ok with other fonts but for bengoli nothing seems to work.

Answer

After lots searching i have found a simple solution for my project, which is to use FreeSerif which is already included in mpdf.

    $mpdf = new MpdfMpdf([

        'default_font' => 'FreeSerif',
        'mode' => 'utf-8',
        'margin_top'=>10,
        'margin_buttom'=>10,


    ]); 

I have added below two lines :

    'default_font' => 'FreeSerif',
        'mode' => 'utf-8',

when initializing mpdf.

Leave a Reply

Your email address will not be published. Required fields are marked *