【问题标题】:How can I change a font style for table of contents?如何更改目录的字体样式?
【发布时间】: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


    【解决方案1】:

    我记得实体打印有这样的问题。

    我最终所做的是为我的 pdf 添加一些 内联样式 到我的 twig 模板 并得到我需要的结果(在 html 和打印的 pdf 上) .

    【讨论】:

    • 非常感谢您的回复,这个问题仍然对我开放。你的意思是我应该编辑我的 entity-print.html.twig 模板吗?我已经更新了我的问题,树枝模板现在对我来说看起来像这样。我应该为 body 标签添加一些内联样式吗?
    猜你喜欢
    • 1970-01-01
    • 2013-10-03
    • 1970-01-01
    • 1970-01-01
    • 2010-11-15
    • 1970-01-01
    • 1970-01-01
    • 2011-11-22
    • 1970-01-01
    相关资源
    最近更新 更多