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