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.


/* Page number at the bottom of page */

@page {

@bottom-center {

content: "Page " counter(page) " of " counter(pages);

font-style: italic;

color: green

}

}

Author: Pradeep Pant

Software Engineer

Leave a Reply

Your email address will not be published. Required fields are marked *