1

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...

Dawid Jurczak
  • 33
  • 1
  • 4
  • Possible duplicate of [Print page numbers on pages when printing html](https://stackoverflow.com/questions/20050939/print-page-numbers-on-pages-when-printing-html) – Ahmad Alfy Jun 04 '19 at 00:19

1 Answers1

1

Try this :

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

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

From This Post

marvc1
  • 3,641
  • 3
  • 25
  • 34
Agoose Banwatti
  • 410
  • 2
  • 13