php - dompdf在完整的bodytag中放置相同的字体
问题描述
我已经在我的 dompdf 中安装了 tangerine。现在发生的事情是当我在我的 Windows 机器上尝试时它工作正常。但是在 ubuntu 中,当我将相同的代码放入 xampp 时,生成的 pdf 会被堆积起来。我只使用了带有 h3 标签的 tangerine 字体,但在生成的 pdf 中,字体样式被放置在整个正文中。这是我的 dompdf 设置
<?php
// Include autoloader
require_once 'dompdf/autoload.inc.php';
// Reference the Dompdf namespace
use Dompdf\Dompdf;
// Instantiate and use the dompdf class
$dompdf = new Dompdf(array('isPhpEnabled' => true));
// Load content from html file
ob_start();
include_once 'pdfcontent.php';
$output = ob_get_clean();
$dompdf->loadHtml($output);
//$dompdf->loadHtml($html);
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('b4', 'landscape');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF (1 = download and 0 = preview)
$dompdf->stream("funeral",array("Attachment"=>0));
?>
解决方案
那么问题基本上出在缓存的 dompdf 文件上。我已删除 dompdf 文件夹并再次上传。现在它工作正常。
推荐阅读
- python - 根据列中的多个条件删除行(使用 Python)
- xamarin.forms - 集合视图中的选取器在 SelectedIndexChanged 中失去价值
- sql - 如何连接具有不同列数据类型的两个表
- mysql - WordPress + MySQL 部署在 Kubernetes - MySQL 连接错误
- python - Django将对象传递给另一种形式的模型
- java - 更新我的实体时出现“ConcurrentModificationException”
- javascript - 不显示标记聚类
- python - 如何阻止 taskmgr.exe 启动?
- python - 用另一个列表中的元素随机替换列表中的某些元素,python
- python - Telegram bot 无法在一条消息中接收多张图片