Question

Locked

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 problem...so 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.ClearContent();
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);
document.Open();
//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
document.Close();
Response.Write(document);
Response.End();


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

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums