I am currently trying to insert page numbers for my PDF generation. I have now tried the following solution with css counters:
I try in the entity-pring.css:
.page { padding: 20px; } .page img { max-width: 100%; height: auto; } .page td img { max-width: none; } @page { margin: 50px 25px 100px 25px; } #footer { position: fixed; bottom: -60px; left: 0px; right: 0px; background-color: #ffffff; height: 50px; } #footer .page:after { content: counter(page) " of " counter(pages); }
and in the entity-print.html.twig I have the following:
<code><html> <head> <meta charset="utf-8"> <title>{{ title }}</title> {{ entity_print_css }} </head> <body> <div class="page"> {{ content }} </div> <div id="footer"> <p class="page">Page </p> </div> </body> </html> </code>
This also works for now:
But as you can see, the back part is still completely missing. Does anyone have any ideas? I’ve already tried a few things, but haven’t found the right solution yet.
Thanks and greetings Bavra
P.S.: I got some inspiration from here https://docraptor.com/documentation/article/1082618-page-numbers