Dawid Jurczak
Dawid Jurczak

Reputation: 43

Adding page numbers in CSS to "html to pdf" converter

I'm using modified by my team PHP tool for converting HTML to PDF. My task is to add number of pages in bottom corner. I never know how many pages I'll have, I don't know after which part I may get a page break.

I can't use Javascript.

I was thinking about using CSS counter, but I have no idea if it's good way, how can I check if page had a break...

Upvotes: 2

Views: 8992

Answers (1)

Agoose Banwatti
Agoose Banwatti

Reputation: 450

Try this :

#pageFooter {
    display: table-footer-group; 
}

#pageFooter:after {
    counter-increment: page;
    content: counter(page); 
}

From This Post

Upvotes: 2

Related Questions