【发布时间】:2015-07-15 13:46:11
【问题描述】:
我正在使用 Zend Framework 并使用 mpdf 创建 PDF。
我正在尝试使用 fontawesome 来表示一些文章,但是 font awesome 的字体没有正确渲染
下面是代码。
$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();
我在 html 中使用的代码
<span class="company-name"> name of the company</span>
提前致谢。
【问题讨论】:
-
看,我使用 PHP 大约 5 或 6 年,每次我需要创建 PDF 时,都不符合我的期望(CSS 或其他一些元素)。所以,我发现(在 stackoverflow 中)一个 API,你只发送你的 HTML,他们返回一个与你的页面完全一样的 PDF。试试看:html2pdfrocket.com
标签: zend-framework font-awesome mpdf