Forum How do I...?

Call Prince from ASP.NET C# code in https website

RickWilliams
It works great in development using localhost, but when I try to run it in secure https mode, the PDF that is generated is that of my login page. I am using prince.SetHttpUser and prince.SetHttpPassword, but it still doesn't work. How can I generate the PDF?
Here is my code.
Prince prince = new Prince(@"C:\Program Files (x86)\Prince\Engine\bin\prince.exe");
prince.SetLog("[SERVER PATH]\\Prince\\princelog.log");
prince.SetHttpUser(SessionGlobal.UserName);
prince.SetHttpPassword(opass);

Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment; filename=\"woundrep2.pdf\"");
prince.AddStyleSheet("[SERVER PATH]\\secured\\css\\styles.css");
prince.AddStyleSheet("[SERVER PATH]\\secured\\css\\landscape.css");
prince.Convert(inFile, Response.OutputStream);

Note that if I use Prince prince = new Prince(); it doesn't work at all.
mikeday
Prince can only use HTTP authentication, if your server has a custom login form then Prince will not be able to get past it. Is inFile a URL pointing back to your same ASP.NET server that is running this code? If so, you could capture the output of the page directly and pass it to Prince, instead of doing a separate HTTP request, and hence bypass the authentication altogether.