小编Meg*_*Fox的帖子

如何在MPDF中使用Font Awesome?

我正在使用Zend Framework并使用mpdf创建PDF.
我试图使用fontawesome来表示一些文章,但字体真棒的字体下面没有正确呈现代码.

$stylesheet =  file_get_contents("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css");
$stylesheet .= file_get_contents("https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css");

$this->mpdf->WriteHTML($stylesheet,1);
$this->mpdf->WriteHTML($html,2);
$this->mpdf->allow_charset_conversion = true; 
$this->mpdf->charset_in = 'windows-1252';
$this->mpdf->Output();
Run Code Online (Sandbox Code Playgroud)

我在html中使用的代码

<span class="company-name">&#xf21b; name of the company</span>
Run Code Online (Sandbox Code Playgroud)

提前致谢.

zend-framework mpdf font-awesome

4
推荐指数
2
解决办法
4614
查看次数

标签 统计

font-awesome ×1

mpdf ×1

zend-framework ×1