phpcodeignitermpdf

Some times getting error of "can not find TTF TrueType font file" for mPDF


I am getting error in creating pdf using mPDF. I have tried all answers given here. Still I am getting below error.

mPDF Error - cannot find TTF TrueType font file - /home/xxxxxx/public_html/app/application/libraries/mpdf60/ttfonts/DejaVuSerifCondensed.ttf

This path seems perfect. And I have also added DejaVuSerifCondensed.ttf in ttfonts folder.

I am defining _MPDF_PATH as

if (!defined('_MPDF_PATH')) define('_MPDF_PATH', dirname(preg_replace('/\\\\/','/',__FILE__)) . '/');

FYI: I am not getting this error every time in some cases I am getting this error.

Thanks in advance.


Solution

  • Finally after long digging I found solution to add all listed fonts available in gituhb to the sever. Hope someone will get help through this.