Author: auzt | Posted on: 7/7/2010 6:26:18 AM | Views : 751

Hi friends,
I am trying to generate a pdf document using the following code which i picked up from one of these forums. It had worked fine when  I exported a gridview to pdf.
Now I need to export HTML code to pdf. Can someone suggest how to proceed, possibly using the gridview exporting code below? Any other approach is also welcome.
Code:
        Response.ContentType = "application/pdf";
        filename = "DocumentName.pdf";
        Response.AddHeader("content-disposition", "attachment;filename=" + filename);
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        StringWriter sw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter( ...

Go to the complete details ...