【发布时间】:2019-06-29 00:22:50
【问题描述】:
在我的 Drupal 8 网站中,我正在从 html 代码生成一个 pdf 文件。它是在实体打印模块和 wkhtmltopdf 引擎的帮助下完成的。在界面中,我可以选择生成目录的选项。但现在对我来说问题是我不知道如何主题目录,即我想分配“Times New Roman”字体样式。
在我指定的 entity_print/css 文件夹下的 entity-print.css 中
@font-face {
font-family: "Times New Roman", sans-serif;
}
body {
font-family: "Times New Roman", sans-serif;
font-size: 17px;
color: #000000;
line-height: 1.6;
}
它影响生成的文档本身,但不影响目录
更新:entity-print.html.twig 对我来说如下所示:
<html>
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
{{ entity_print_css }}
</head>
<body>
<div class="page">
{% for chapter in content%}
<div class="section">
{{ chapter }}
</div>
{% endfor %}
</div>
</body>
</html>
【问题讨论】:
标签: pdf themes wkhtmltopdf tableofcontents