In my Drupal 8 website I am generating a pdf file from html code. It is done with the help of Entity Print module in combination with wkhtmltopdf engine. In the interface I could select the option to generate the table of contents. But now the issue for me is that I do not know how to theme table of contents, namely I want to assign "Times New Roman" font style.
In the entity-print.css under entity_print/css folder I have specified
@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;
}
It affects the generated document itself, but not the Table of Contents
UPDATED: the entity-print.html.twig looks as following for me:
<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>
I remember having a problem like this with entity print.
What i did eventually was to add some inline styles to my twig template for my pdf and got the results that i needed (both on html and on printed pdf).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.