5
我正在使用Rotativa在我的“MVC”应用程序中生成PDF。我怎样才能保存Rotativa PDF?在完成所有过程后,我需要将文档保存在服务器上。下面如何在服务器上保存Rotativa PDF
代码:
public ActionResult PRVRequestPdf(string refnum,string emid)
{
var prv = functions.getprvrequest(refnum, emid);
return View(prv);
}
public ActionResult PDFPRVRequest()
{
var prv = Session["PRV"] as PRVRequestModel;
byte[] pdfByteArray = Rotativa.WkhtmltopdfDriver.ConvertHtml("Rotativa", "Approver", "PRVRequestPdf");
return new Rotativa.ViewAsPdf("PRVRequestPdf", new { refnum = prv.rheader.request.Referenceno });
}
该解决方案采用了丹尼尔的回答了。 – meJustAndrew 2016-08-08 18:58:25