1

I'm using NReco html-to-pdf converter to deliver a file stream representing a PDF document through an action method. However it seems that when I invoke the method HtmlToPdfConverter.GeneratePdf although the response is delivered correctly the session is abandoned right after. I know that because the event handler Session_End gets executed on the global.asax.

This premature non-explicit expiration of the session makes the application to misbehave in further requests that query the session object (now set to null)

That does not happen when I generate the PDF files with another third-party library: i. e. the pdf file is generated and served and the session keeps its state until it expires normally after some idle time.

Can NReco PDF Generator somehow fire the event Session_End on an ASP.Net MVC Application?

I know it would be easier to use the pdf library that does not show that behavior however it does not support some feature that Nreco does like CSS and javascript :S

Regards and thanks for your help

Néstor
  • 31
  • 1
  • Hi there! I spent my day around the same issue, I found out it's related to this one https://stackoverflow.com/questions/41737133/application-end-after-saving-pdf-file-in-asp-net I've just set in my web.config and everything work fine! – webStuff Apr 02 '20 at 06:12

0 Answers0