1

I'm trying to implement a web solution to convert a web-page to a PDF file. To deal this, I've followed these steps, but, when I've implemented this, this takes too long to load the PDF and I'm not sure if it does because it still loading until this moment.

I'm actually developing this web-app using ASP.NET MVC 4. And, my implementation is:

[HttpGet]
        public ActionResult Imprimer(string type = "", string dns = "", string domaine = "", string nomPoste = "", string stats = "", string date1="", 
            string date2 = "")
        {
            return new ActionAsPdf(
                           "Index",
                           new { type = type, dns = dns, domaine = domaine, nomPoste = nomPoste, stats = stats, date1 = date1, date2 = date2 }
                           ) { FileName = "Statistique-"+DateTime.Now.ToString()+".pdf" };
        }

Knowing that the first parameter of ActionAsPdf is the web-page from here I'm executing the Imprimer action and the second parameters are request's parameters.

Can someone light up what is wrong with this?

ABCmo
  • 239
  • 1
  • 6
  • 16
  • Is it the same as this? http://stackoverflow.com/questions/21610854/error-converting-mvc4-view-to-pdf-with-rotativa-or-razorpdf – Giorgio Bozio Feb 20 '14 at 14:00
  • Thanks for your reposte @GiorgioBozio Pasting the answer's code, doesn't solve the problem. – ABCmo Feb 20 '14 at 23:14
  • Rotativa may not support HttpGet method. HttpGet method need JsonrequestBehaviour.AllowGet. try HttpPost Method.. – Yunus BAYRAK Oct 29 '14 at 21:33

0 Answers0