我正在使用 Rotativa在我的 mvc4 应用程序中创建 pdf。问题是我如何在 pdf 上显示页码。
最佳答案
此代码将在页脚中央为您提供页码。
return new Rotativa.ViewAsPdf()
{
CustomSwitches = "--page-offset 0 --footer-center [page] --footer-font-size 8"
}
使用 --page-offset 选项设置起始页码。 将页面偏移设置为 0,页码将从 1 开始(这也是默认选项)。 可以通过指定 --footer-font-size 选项来控制字体大小。
关于c# - Rotativa PDF MVC3 分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16806527/