Last post May 24, 2011 12:41 AM by mi_sha
May 23, 2011 05:29 AM|mi_sha|LINK
I have a console application where i use HttpWebResponse to get the web page data. This data contains some images also. Image path may be something like http://url/images/img.jpg. I used iTextSharp to render html data to pdf. But on saving image to pdf , it
shows an error like 'remote server returned error 401'. Anyone know the solution?
Which all are the best html to pdf converter (opensource) ?
May 23, 2011 06:21 AM|DarrellNorton|LINK
The solution to your problem is to modify the source code (which is easy since iTextSharp is open source). Just modify according to these instructions:
May 23, 2011 07:37 AM|mi_sha|LINK
Could you please help me. I didn't get a clear idea about it. How can i make changes in these classes?
May 23, 2011 08:25 AM|mi_sha|LINK
I've modified itextsharp-all-5.1.0 BmpImage code in itextsharp.txt.pdf.codec, and Build it and used the new DLL in console application. But still it showing the same problem. What would be the problem?
May 24, 2011 12:41 AM|mi_sha|LINK
I've added default credential in GetInstance(Uri url) method of Image class. Now its not showing any errors. Now its showing html data, but image is missing in the pdf file.
This is my code,
HtmlToPdfBuilder builder = new HtmlToPdfBuilder(PageSize.LETTER);
HtmlPdfPage first = builder.AddPage();
byte file = builder.RenderPdf();