我尝试生成pdf并将其存储在文件夹中。我的php代码如下:
require_once("dompdf-master/dompdf_config.inc.php");
$dompdf = new DOMPDF();
$html=$html."<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><style>body{font-family:'dejavu sans';font-size:10px;}... </style></head><body>";
.
.
$dompdf->load_html($html);
$dompdf->set_paper("A4", "landscape");
$dompdf->render();
$dompdf->stream("one.pdf", array("Attachment" => false));
$canvas = $dompdf->get_canvas();
$font = Font_Metrics::get_font("helvetica", "bold");
$canvas->page_text(750, 570, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font, 6, array(0,0,0));
$canvas->page_text(25, 570, "", $font, 6, array(0,0,0));
$output = $dompdf->output();
$file_to_save = './uploads/one.pdf';
file_put_contents($file_to_save,$output );
但是我这样:
这里font-family也改变了。请有人帮助我吗?