EO.Pdf by Essential Objects – Extending to include cookie authentication


EO.Pdf  has its own internal browser to generate the PDF, therefore /MVC cookies are not shared across EO.Pdf  and When you ret to generate PDF using HtmlToPdf.ConvertUrl(“your url”,pdfDocument); you will probably get your unauthorised page or Login page in the PDF that is generated.


The solution is to add cookie to HtmlToPdfOptions. Wrote an extension method include the cookies, like below

in your PDF generation code you can use it like below


Leave a comment