有时 mPDF 会出现 "can not find TTF TrueType font file" 错误

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

我在使用 mPDF 创建 pdf 时遇到错误。我已经尝试了 here 给出的所有答案。我仍然低于错误。

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

这条路看起来很完美。我还在 ttfonts 文件夹中添加了 DejaVuSerifCondensed.ttf。

我将 _MPDF_PATH 定义为

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

仅供参考:我不是每次都收到这个错误,在某些情况下我会收到这个错误。

提前致谢。

经过长时间的挖掘,我终于找到了将 gituhb 中列出的所有可用字体添加到服务器的解决方案。希望有人能通过这个得到帮助。