Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to create a footer with pagination #73

Closed
hervehobbes opened this issue Aug 29, 2019 · 3 comments
Closed

How to create a footer with pagination #73

hervehobbes opened this issue Aug 29, 2019 · 3 comments
Labels

Comments

@hervehobbes
Copy link

Hello,

Sorry if this question is obvious but I can't find how to create a footer (for example with an html files), that will contains the current page and the total page number, something like this:

Page {{pageNumber}} / {{totalPages}}

For example

Page 1/5

If I write this inside my html footer, it is rendered, in the PDF, as is...

Thanks by advance

@BlueHatbRit
Copy link
Owner

Hi @hervehobbes this is a perfectly valid question. Sadly right now it can't be supported, it used to be when we used Phantom.js to generate our PDF's but since Phantom has been deprecated and development has stopped, we've been forced to move to Chrome Puppeteer. Puppeteer however doesn't support pushing in page numbers into a PDF. It's unspeakably terrible of them but it's what we're left with right now.

I'd really encourage you to open an issue / upvote any existing issues about this on the Puppeteer page because it's really quite a vital component of browsers rendering PDF's.

I'm so sorry we can't support this yet, the moment it's avalible I'll integrate it!

@hervehobbes
Copy link
Author

Hello @BlueHatbRit,

Thank you very much for your answer and suggestion.

Bye,
Hervé

@travs
Copy link
Collaborator

travs commented Mar 15, 2020

Hey Elliot, was wondering if this is supported now in puppeteer. It looks like it to me, but I can't get page numbers to render when I pass mdpdf something like:

"<div><div class='pageNumber'></div> <div>/</div><div class='totalPages'></div></div>"

Maybe I'm just missing something about how puppeteer works here though.

@BlueHatbRit

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

No branches or pull requests

3 participants