Pask
Pask

Reputation: 335

html2pdf page number

I've got a html code and when I convert it to pdf using html2pdf, it is longer than a single page, and I need to put the page number in both pages.

I've tried putting the page_footer code as it is said in this post: html2pdf page numbering

but it only shows the page number in the last page, not in the first one. I can modify the html code, but I understand that if I put the tag at the end of it, html2pdf thinks that it refers to the end of the code, not the end of the page.

How can I put the page number in all the pages, from the first one to the last?

thank you!

Upvotes: 2

Views: 6556

Answers (1)

JordiVilaplana
JordiVilaplana

Reputation: 485

You can put the attribute footer="page" in the <page> tag and all the pages will be auto-numbered.

<page footer="page">
    <page_header>
        /* Page Header */
    </page_header> 
    <page_footer>
        /* Page Footer */
    </page_footer>

    /* Page Content */
</page>

html2pdf:en:v4:page

Upvotes: 3

Related Questions