|
-
Sep 30th, 2009, 01:57 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Got error while export aspx page to pdf
Hi friends,
I resolved forum that export aspx page to pdf. Its working fine when some paragraph inside table. If image file is appear the error is coming.
Export aspx page to pdf. The below code workin in this type.ie.,<table>some para </table>
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition",
"attachment;filename=GridViewExport.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
this.tblpdf.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
But inside the table the image source file is appear it will give exception.
<table width="680" border="0" cellspacing="0" cellpadding="0" align="center" id="print_doc" runat="server">
<tr>
<td height="25" colspan="2" valign="bottom" class="title1">ACCOUNTS</td>
</tr>
<tr><td colspan="2" style="border-bottom:2px solid #a70c29"><img src="images/space.gif" width="1" height="10" /></td></tr>
<tr><td><img src="images/space.gif" width="1" height="25" /></td></tr>
</table>
Error is "Could not find a part of the path 'C:\images\space.gif"
Please suggest me. How can we rectify this problem??
Hopes your reply
Thanks
Failing to plan is Planning to fail 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|