Pradeep K. Pant Blog

 

CSS based page numbering in PDF creation

I frequently use PDF engine for generating PDF of multiple web pages a kind of book. Though you can use engine specific switch to insert page number(s) but if you want beautiful CSS based numbering then below code can be used. Just paste the code in a .CSS file and link to your html pages.

[code lang=”css”]
/* Page number at the bottom of page */

@page {

@bottom-center {

content: ”Page “ counter(page) ” of “ counter(pages);

font-style: italic;

color: green

}

}
[/code]



 

 

Copyright © 2007-2024 PRADEEP K. PANT

Source Code | RSS