문제

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

도움이 되었습니까?

해결책 2

You should be able to leverage page footer options on wkhtmltopdf by adding a CustomSwitches property to Rotativa *AsPdf. Take a look at http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top