【发布时间】:2012-04-02 11:30:59
【问题描述】:
我刚开始使用带有 Codeigniter 的 dompdf v0.6.0beta3 和 dompdf Codeigniter helper。我已将 Arial 字体系列 tff 文件从 Windows 7 字体文件夹复制到 dompdf 的 /lib/fonts 文件夹。
问题:当我使用 CSS 选择一个文本并应用 font-weight: bold 属性时,在 HTML 输出上确实是粗体,但是通过 dompdf 转换为 PDF 后,文本不再是粗体!
font-size: 24px 不起作用,pdf 中的所有文本大小相同。 pdf 中使用的唯一字体似乎是 Times New Roman!
如何使我的文本加粗并在 pdf 中更改其大小和字体?
PHP(控制器)
function pdf() {
$this->load->model('resume_model');
$results = $this->resume_model->get_resume_details($user_id);
$this->load->helper(array('dompdf', 'file'));
$html = $this->load->view('resume_pdf', $results, true);
pdf_create($html, 'filename');
}
【问题讨论】:
-
也许这可以帮助你:code.google.com/p/dompdf/wiki/FAQ 并搜索粗体
-
不能使用 css 的
font-weight: bold属性设置粗体文本?这就是我从 dompdf 样本中看到的 pxd.me/dompdf/www/examples.php#samples
标签: php html css codeigniter dompdf