I successfully used the EVO HTML to PDF tool in a previous project and now I'm trying to to integrate it in another project. The problem is that the page I have to convert is behind the ASP.NET forms authentication and when I convert the page I get the login form. How can I pass over forms authentication and get the page content in PDF?
Asked
Active
Viewed 755 times
1 Answers
2
You can use the following code to get the Forms Authentication cookie from current request and pass it to converter to be used when accessing the HTML page to convert:
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
// Add the Forms Authentication cookie to request
if (Request.Cookies[FormsAuthentication.FormsCookieName] != null)
{
htmlToPdfConverter.HttpRequestCookies.Add(FormsAuthentication.FormsCookieName,
Request.Cookies[FormsAuthentication.FormsCookieName].Value);
}
htmlToPdfConverter.ConvertUrl(urlToConvert);

EvoPdf
- 523
- 3
- 9
-
I found this later on the website but after some research, and yes, this is the correct solution. – Developer Rent Oct 14 '14 at 15:47