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.
But should be
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(); `
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.
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.
But should be
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}'], ] ]);