我想使用 2 个 View 生成一个 pdf。我的目标是从第一个 View 生成第一页,从第二个 View 生成第二页。
这是我当前的代码:
var actionPDF = new Rotativa.ActionAsPdf("DownloadDividendSummaryPdf", new { ReportType = DividendType, Time = DividendTime })
{
FileName = "DividendPortfolio" + email + ".pdf",
PageSize = Size.A4,
MinimumFontSize = 12,
//PageMargins = new Margins(3, 3, 3, 3),
IsGrayScale = true,
IsJavaScriptDisabled = true,
IsBackgroundDisabled = true,
};
actionPDF = new Rotativa.ActionAsPdf("DownloadDividendDetailedPdf", new { ReportType = DividendType, Time = DividendTime, StartDate = G_StartDate, todate = G_ToDate })
{
FileName = "DividendPortfolio" + email + ".pdf",
PageSize = Size.A4,
MinimumFontSize = 12,
//PageMargins = new Margins(3, 3, 3, 3),
IsGrayScale = true,
IsJavaScriptDisabled = true,
IsBackgroundDisabled = true,
};
最佳答案
要么合并 PDF(这很重要),要么简单地创建一个 View 来呈现其他两个 View 的输出,然后将那个 View 呈现为 PDF。
关于c# - 使用 Rotativa 从多个 View 生成 pdf?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48281814/