ASPX to PDF conversion image path problem

By vilas.gurav7777 ·
HI i am trying to convert aspx to pdf but while converting if images are on aspx page means its searching the images path on hard disk instead of serching on root directory ...and if i place the images on specified path like F:\img.jpg then its not giving any please let me know if any good answer/solution for this issue...i am using following code to solve the above issue

string attachment = "attachment; filename=Article.pdf";
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/pdf";
StringWriter stw = new StringWriter();
HtmlTextWriter htextw = new HtmlTextWriter(stw);
form1.RenderControl(htextw);// (this is the error part)
Document document = new Document();
PdfWriter.GetInstance(document, Response.OutputStream);
//iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(imagepath + "/mikesdotnetting.gif");
StringReader str = new StringReader(stw.ToString());
HTMLWorker htmlworker = new HTMLWorker(document);
htmlworker.Parse(str);//Here is the error

please give soltion waiting for reply..many thanks in advance

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums