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

Generating Pdf in a background job (without HttpContext or ControllerContext) #233

Open m-okhovat opened 1 year ago

m-okhovat commented 1 year ago

Hi, webgio. It looks like in order to building a pdf from a view it is mandatory to use the "BuildFile(ControllerContext context)" method which requires ControllerContext as an input argument. So what can we do when there is no HttpContext, for instance consider a scenario in which you are intended to generate some pdfs and email them to some clients in a background job (e.g. Hangfire)? Is there any workaround for it?

KevinRo96 commented 1 month ago

Hi, were you able to find a solution to the problem, I have the same problem and I can't get it to work in any way from my background task.