Why does Rotativa always generate my login page? Why is it slow?

前端 未结 5 2535
一整个雨季
一整个雨季 2020-12-15 08:24

I was using this Rotativa 1.6.4 code example to generate a PDF from a page in my .NET MVC 5 app.

public ActionResult PrintIndex()
{
    var a = new ActionAsP         


        
5条回答
  •  自闭症患者
    2020-12-15 08:54

    I hope this code solve first question

    public ActionResult DownloadViewPDF() {
     Dictionary cookieCollection = new Dictionary();
       foreach (var key in Request.Cookies.AllKeys)
         {
           cookieCollection.Add(key, Request.Cookies.Get(key).Value);
         }
         return new ActionAsPdf("Index")
           {
              FileName = "Name.pdf",
              Cookies = cookieCollection
            };
         }
    

提交回复
热议问题