Forum How do I...?

Empty pdf

neelima_kaja
Hello,

I am getting an empty pdf when i use the convert method. Also the log file is not getting created. I am using the same code else where and it is working. And when i try to use the Prince standalone application with the htmlString the pdf is coming up fine. I am kind of lost here. Here is the code

Prince pdfConverter = new Prince(pdfConverterAppPath);
MemoryStream pdfOut = new MemoryStream();
pdfConverter.SetLog(@"pdf.log");

pdfConverter.SetHttpUser(System.Configuration.ConfigurationManager.AppSettings["programaticHTTPAuthenticationUsername"]);
pdfConverter.SetHttpPassword(System.Configuration.ConfigurationManager.AppSettings["programaticHTTPAuthenticationPassword"]);

pdfConverter.SetEmbedFonts(true);
pdfConverter.SetBaseURL(ConfigurationManager.AppSettings["princeBaseURLPath"]);

pdfConverter.Convert(htmlString, pdfOut);
mikeday
Sounds like the Prince executable is never running, perhaps due to a permissions issue on the server, unless it is as simple as an incorrect path for pdfConverterAppPath. Do you know of any different settings on this server compared with servers on which it is working?
neelima_kaja
I am doing this on my local machine, and place it is working is also on my local but in a different file in the same solution.
mikeday
So it is working when called from a different ASP page on the same server? That's odd. Is there any difference in the value for pdfConverterAppPath, or anything unusual in the htmlString?