How to save Rotativa PDF on server

后端 未结 4 1559
花落未央
花落未央 2020-12-31 11:37

I am using Rotativa to generate PDF in my \"MVC\" application. How can I save Rotativa PDF? I need to save the document on a server after all the process is completed.

4条回答
  •  再見小時候
    2020-12-31 12:26

    Another useful answer:

    I found the solution here

                var actionPDF = new Rotativa.ActionAsPdf("YOUR_ACTION_Method", new { id = ID, lang = strLang } //some route values)
                {
                    //FileName = "TestView.pdf",
                    PageSize = Size.A4,
                    PageOrientation = Rotativa.Options.Orientation.Landscape,
                    PageMargins = { Left = 1, Right = 1 }
                };
                byte[] applicationPDFData = actionPDF.BuildPdf(ControllerContext);
    

    This is the original thread

提交回复
热议问题