Rotativa PDF MVC3 Paging

user437329 picture user437329 · May 29, 2013 · Viewed 8.2k times · Source

Am using Rotativa to create pdfs in my mvc4 application. Problem is how do i get display page numbers on the pdfs.

Answer

alchi baucha picture alchi baucha · Jul 15, 2017

This code will give you a page number at the center of the footer.

return new Rotativa.ViewAsPdf()
{
    CustomSwitches = "--page-offset 0 --footer-center [page] --footer-font-size 8"
}

Use --page-offset option to set the starting page number. Set the page offset to 0 and the page number will start at 1 (This is also the default option). Font size can be controlled by specifying the --footer-font-size option.