php - 使用 Dejavu 字体时,DOMPDF 输出到服务器不显示文本
问题描述
当您使用 DOMPDF 在服务器上保存 PDF 并且想要在服务器上查看/打开 PDF 时,你们中的某个人遇到过问题,之后看不到字符而是块?
我有以下输出。
//Download PDF
$dompdf->stream("Invoice: ".$row['number'].".pdf", array("Attachment"
=> true));
//save the pdf file on the server
file_put_contents('uploads/'.$row['number'].'.pdf', $dompdf-
>output());
这用于样式:
*{ font-family: DejaVu Sans;}
@font-face {
font-family: "DejaVuSans";
font-style: normal;
font-weight: normal;
src: url('fonts/DejaVuSans.ttf') format('truetype');
}
解决方案
推荐阅读
- python - 如何解决 python Dropbox 上传脚本中的超时错误?
- .net-core - ANCM:进程内:从进程外模式切换到进程内后出现 500 错误
- html - 如果用户在 Angular 中查看他/她自己的个人资料,如何不显示按钮?
- arrays - 如何从数组反应中删除正确的元素?
- postgresql - Docker postgress 用户“postgres”没有分配密码
- python - 如何使用 python apply/lambda/shift 函数根据 2 列的值获取该特定列的前一行值?
- ssrs-2008 - SSRS 货币未显示为加元
- javascript - 来自个人经验或资源的优化建议
- azure - 在 yaml 文件中转换可视化构建管道
- amazon-web-services - 自动伸缩组:如何允许从我自己的 ec2 入网?(子网?)