webgio / Rotativa

Rotativa, /rota'tiva/. Make Pdf from Asp.Net MVC. Available on Nuget https://www.nuget.org/packages/Rotativa
http://letsfollowtheyellowbrickroad.blogspot.it/search/label/Rotativa
MIT License
621 stars 224 forks source link

Importing a page with JS and Windows authentication #192

Open Laser42 opened 6 years ago

Laser42 commented 6 years ago

Hello! Thank you for the library!

I have an MVC 5 project which uses Windows authentication. In order of adding pdf export support, I try to set up Rotativa lib. The first try was Controller method

public ActionResult PrintViewToPdf()
{
    return new ActionAsPdf("myAction");
}

which results as error 401.2 page in pdf file. As i understand (please let me know if there is another solution!!!), there is the only workaround:

public ActionResult PrintViewToPdf()
{
    return new ViewAsPdf("myView");
}

In this case, I get a pdf file, but it contents a web page withount javascript scripts completed!

So, the question: is any another solution instead of replace ActionAsPdf to ViewAsPdf? If no, is it a solution to make ViewAsPdf include javascript execution results?

Thank you!