I've installed Entity Print in order to create PDF files. I've read the documentation to enable a twig template to customize the pdf output, but I don't know how to do simple things, in the twig file, like add a page header and footer, add a front page, etc. Are there any docs about how to customize it?

1 Answer 1


It depends on which print engine you're using. I am using the following entity-print.html.twig with the dompdf engine.

    <meta charset="utf-8">
    <title>{{ title }}</title>
    {{ entity_print_css }}
{# The footer is repeated on all pages and must be printed first. #}
    {{  footer  }}
{%  if cover_page  %}
<div class="cover-page">
    {{ cover_page }}
{%  endif  %}
{# The header is repeated after the cover page for all pages. #}
    {{  header  }}
<div class="page">
    {{ content }}

The header and footer must be styled with position: fixed, after which they are displayed on every page.

I haven't found any great combined reference for the entity print module, but searching for what you want to accomplish along with your print engine's name should be helpful.

  • Thank you for your answer. I installed WkHtmlToPdf, but only because It was the first option in the documentation. After read your answer I have installed dompdf and I will use this engine. I don't care the engine if I can do what I need. Thanks.
    – briast
    Jun 15, 2019 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.