Does anyone have any example code in .NET (VB or C# doesn't matter) that would show how one would use Prince to dynamically convert an HTML page and return the rendered PDF in the response?
I know the following code has issues, but i'm hoping it will at least convey what i'm trying to do:
The code above might be used, for example, upon a button click event or something.
Any help would be greatly appreciated-
I know the following code has issues, but i'm hoping it will at least convey what i'm trying to do:
Prince prince = new Prince(@"C:\Program Files (x86)\Prince\Engine\Bin\Prince.exe");
prince.SetLog(@"C:\princelog.log");
HttpWebRequest request = WebRequest.Create("http://localhost/whatever/default.aspx") as HttpWebRequest;
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
// instantiate some kind of output stream ???
Stream outputPdf; // obviously not exactly right...
prince.Convert(response.GetResponseStream(), outputPdf);
HttpContext.Current.Response.Write(outputPdf); // obviously this isn't exactly right either..
HttpContext.Current.Response.End();
The code above might be used, for example, upon a button click event or something.
Any help would be greatly appreciated-