Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issues with header and footer templates #77

Open
kimmobrunfeldt opened this issue Aug 5, 2018 · 2 comments
Open

Issues with header and footer templates #77

kimmobrunfeldt opened this issue Aug 5, 2018 · 2 comments
Labels

Comments

@kimmobrunfeldt
Copy link
Member

kimmobrunfeldt commented Aug 5, 2018

This issue gathers a lot of issues with PDF header and footer templates. They are not as flexible as I and apparently many others have thought.

Headers and footers are not appearing

Working example: https://url-to-pdf-api.herokuapp.com/api/render?url=https://github.com&pdf.margin.bottom=100px&pdf.displayHeaderFooter=true&pdf.footerTemplate=%3Cp%20style=%22font-size:20px%22%3EFooter%20text%3C/p%3E

Styling is not working

See puppeteer/puppeteer#2916 and puppeteer/puppeteer#2388

@RayAnti2
Copy link

RayAnti2 commented Aug 8, 2018

I found puppeteer is a good tool for converting from html to pdf.
But the footerTemplate must be the same on all pages?
Now I need, for example, pages' footer like this:

(page 1)
pageNumber of totalNumber---------------------------vocabulary list

(page 2)
vocabulary list-------------------------------------pageNumber of totalNumber

(page 3)
pageNumber of totalNumber---------------------------vocabulary list

I prepared 2 Templates for odd and even num pages
How should i do ?

@germanger
Copy link

germanger commented Jan 15, 2021

I would add:

Remember to set a font-size of 8px or more, because the default is almost invisible

<div style='font-size: 8px; margin-left: 30px'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>

Also don't use <span class='pageNumber' />.

Close it with </span>

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants