【发布时间】:2015-03-18 06:48:40
【问题描述】:
我想使用 Arial 作为我的 PDF 的字体。但它只适用于本地站点,而不是在线。我正在用 Codeigniter 做这个项目。下面是我的代码。
@font-face {
font-family: "arial";
src: url('<?php echo admin_asset_url();?>/arial.ttf');
}
body,h1,h2,h3,li,a,p,h4{
font-family: "arial";
}
function pdf_create($html, $filename='', $stream=TRUE)
{
require_once("dompdf/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
if ($stream) {
$dompdf->stream($filename.".pdf");
} else {
return $dompdf->output();
}
}
【问题讨论】:
标签: php css codeigniter dompdf