Hi,
I'm, trying to export the current page to PDF.
But i'm facing some hiccups.
Attached is the code which is called on the Button Click
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
Page page = new Page();
System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
// img.ImageUrl = GetUrl("images/Desert.jpg");
page.Controls.Add(img);
page.RenderControl(hw);
string html = sw.ToString();
html = Regex.Replace(html, "</?(a|A).*?>", "");
StringReader reader = new Str ...
Go to the complete details ...