Rotativa.AspNetCore 1.3.2 is not working after deployment

73 Views Asked by At

Rendering my view as pdf using Rotativa is working like a charm in development but not after deployment. My web app is hosted on Azure. When I try to print pdf after deployment, the process keeps loading till it finally fires a time out error as shown bellow:

enter image description here

I looked into all previous similar questions but I can't seem to find one having the same issue as mine. I tried some fixes mentioned there and added few dll files to my Rotativa folder in my root but that didn't change the outcome. The files inside the folder currently look like this:

enter image description here

My action looks like this:

[HttpPost]
public IActionResult ActionName(ModelName c, string calculate)
{
    ModelState.Clear();

    c.DropDownListChange();

    if (calculate == "calculate")
    {
        c.Run();
        return View(c);
    }
    else if (calculate == "print")
    {
        c.Run();
        return new ViewAsPdf(c)
        {
            FileName = "Test.pdf",
            PageMargins = { Left = 10, Right = 10 },
            PageHeight = 700,
            PageWidth = 309.9
        };
    }
    else
    {
        return View(c);
    }
}

Does anyone have any idea as to what could be causing my problem? I am still a newbie so detailed directions will be very much appreciated.

1

There are 1 best solutions below

0
user20593243 On

I am not sure if I should be deleting this question or not but I just discovered my problem resides with the Azure App service plan. I have the free plan F1 which does not seem to support pdf rendering regardless of what kind of package is being used!