MPDF:找不到TTF TrueType字体文件 [英] mpdf: cannot find TTF TrueType font file

查看:424
本文介绍了MPDF:找不到TTF TrueType字体文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据本文,我正在尝试在CodeIgniter中实现mpdf: http://codeigniter.com/wiki/mPDF_with_Codeigniter

I'm trying to implement mpdf in CodeIgniter according to this article: http://codeigniter.com/wiki/mPDF_with_Codeigniter

我完全按照此处描述的方式进行操作,但出现错误:

I did it exactly the same way that is described there, but I got an error:

mPDF错误-找不到TTF TrueType字体文件-mpdf/ttfonts/DejaVuSansCondensed.ttf

mPDF Error - cannot find TTF TrueType font file - mpdf/ttfonts/DejaVuSansCondensed.ttf

但是文件在那里.我在网络服务器和本地主机上都对此进行了测试.我更改了chmod,但没有效果.

But the file is there. I tested this both on a webserver and on localhost. I changed chmod, neither did that have an effect.

我该怎么办?

推荐答案

我发现了问题所在.

按照CodeIgniter Wiki的建议,我首先将mpdf.php中的_MPDF_PATH设置为:

As recommended in the CodeIgniter Wiki, I first had _MPDF_PATH in mpdf.php set to:

if (!defined('_MPDF_PATH')) define('_MPDF_PATH','mpdf/');

将其更改为绝对路径后,一切正常.绝对路径如下所示:

After I changed it to the absolute path, everything worked. The absolute path looks like this:

if (!defined('_MPDF_PATH')) 
define('_MPDF_PATH','/home/example.com/htdocs/ci/application/libraries/mpdf/');

这篇关于MPDF:找不到TTF TrueType字体文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆