kartik-v / yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.
http://demos.krajee.com/mpdf
Other
161 stars 150 forks source link

Tamil font in mpdf #109

Closed devpower2 closed 3 years ago

devpower2 commented 4 years ago

Hi,

I'm using tamil font in latest yii2 kartik's pdf library. But i'm not getting proper output on pdf. Getting tamil text in pdf as bellow.

problem

But should be

expected

I'm using catamaran ttf font from google. I have checked with many font but result is same.

Here is my PHP code. ` $pdf = new Pdf([ // set to use core fonts only 'mode' => Pdf::MODE_ASIAN, 'defaultFont' => 'catamaran', // A4 paper format 'format' => Pdf::FORMAT_A4, // portrait orientation 'orientation' => Pdf::ORIENT_PORTRAIT, // stream to browser inline 'destination' => Pdf::DEST_BROWSER, // your html content input 'content' => $content,
// format content from your own css file if needed or use the // enhanced bootstrap css built by Krajee for mPDF formatting 'cssFile' => [ '@vendor/kartik-v/yii2-mpdf/src/assets/kv-mpdf-bootstrap.min.css', '@appBasePath/themes/cerulean/css/bootstrap.css', '@appBasePath/themes/cerulean/css/site.css', ], // any css to be embedded if required 'cssInline' => ' body {font-family: "catamaran" !important;}', // set mPDF properties on the fly 'options' => ['title' => 'Krajee Report Title'], // call mPDF methods on the fly 'methods' => [ 'SetHeader'=>['Krajee Report Header'], 'SetFooter'=>['{PAGENO}'], ] ]);

        // return the pdf output as per the destination setting
        return $pdf->render(); `
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.