我已经尝试了很多答案,并与结论没有甚至开发商自己,我有得到由一个复杂的模块中创建一个索引页答案出来了,视图接收与ActionAsPdf模块,并产生除了当页的PDF打破表继续在下一页覆盖表头顶部的记录.
public ActionResult PrintRoster(Guid id)
{
string footer = "--footer-right \"Date: [date] [time]\" " + "--footer-center \"Page: [page] of [toPage]\" --footer-line --footer-font-size \"9\" --footer-spacing 5 --footer-font-name \"calibri light\"";
return new ActionAsPdf("RosterPDF",
new { id = id }) { FileName = "ClassRoster.pdf",
PageSize = Rotativa.Options.Size.A4,
PageOrientation = Rotativa.Options.Orientation.Portrait,
MinimumFontSize = 16,
PageMargins = {Top = 15, Bottom = 22},
PageHeight = 40,
CustomSwitches = footer
};
}
Run Code Online (Sandbox Code Playgroud)
创建RosterPDF然后生成有问题的PDF
@model Training.ViewModels.RosterViewModel
@using Training.UtilModels
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head> …Run Code Online (Sandbox Code Playgroud)