I know that this topic has been discuss on several articles, but none of the solution help me.
I have this action:
public ActionResult DownloadViewPDF(string userId)
{
var model = db.MyCvs.FirstOrDefault(u => u.UserId == userId);
if (model != null)
return new Rotativa.ViewAsPdf("ViewUserCv", model) { FileName = model.FirstName + model.LastName + "_CV.pdf" };
return Content("there is no Cv to download");
}
Using the above action I am downloading a view as pdf, and everything is working as expected on my computer.
After deploying the project on the server, this action is not working, is returning an error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I am using Visual Studio Community 2015.
On the server I have the Rotativa.dll
and also the Folder in the root directory named Rotativa with the file inside named wkhtmltopdf.exe
.
I do not know how to handle this error, can you give me some sugestions?