Rotativa and stylesheets, pagenumbering, bootstrap

540 views Asked by At

I'm creating a small MVC5 C# webapplication that need to output pdf files. I chose Rotativa as I read online it was most used in MVC and PDF generation. But I'm having a problem when using a cover, a custom TOC and pagenumbering.

I'm using the customSwitches that I did find in the documentation. Below is my customSwitches string.

String path = HostingEnvironment.MapPath("~/Content/CustomTOC.xsl");
string customSwitches = string.Format(
    "cover {1} toc --xsl-style-sheet {2} --header-right [page] --footer-html {0} --footer-spacing -20 ", 
    Url.Action("Footer", "Rapportage", new { area = "", Id = SelectedUser.Id }, "http"), 
    Url.Action("Cover", "Rapport", new { area = "", Id = SelectedUser.Id }, "http"), 
    path);

The problem what I'm facing is that pagenumbering only works on the TOC page. After that no page numbering is visible.

Besides that, it seems that bootstrap is not working within my pagis, the font is small and not what it should be.

Can anyone show me an example of the good use of Rotative with a custom TOC and pagenumbering?

0

There are 0 answers