I am using winnovative html to pdf converter. I need to create pdf report for a div in the page not the whole page. Hence I am overriding the page Render event. It works but my problem is it is not working when some the code from JavaScript is added to div. The javascript code is generated by a third party tool for html reporting. I always get the parent div as empty.
I am using following code to get the html string
protected override void Render(HtmlTextWriter writer)
{
string test = writer.ToString();
if (convertToPdf)
{
TextWriter tw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(tw);
//--- Render this page into the string writer
base.Render(htw);
//--Get HTML of this page
string thisPageHtml = tw.ToString();
//----Calling function which create pdf from html string
ConvertHTMLStringToPDF(thisPageHtml);
}
else
{
base.Render(writer);
}
}