<div id="exportButton">
<asp:Button Width="150px" Style="margin-left: 3px;" data-exclude="true" ID="Button1" Height="27px" runat="server"
OnClick="Button1_Click" Text="Download Report" />
</div>
protected void Button1_Click(object sender, EventArgs e)
{
//Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
WebKitConverterSettings settings = new WebKitConverterSettings();
//Set WebKit path
settings.WebKitPath = Server.MapPath("~/QtBinaries");
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
//Get the current URL
string url = HttpContext.Current.Request.Url.AbsoluteUri;
//Convert URL to PDF
PdfDocument document = htmlConverter.Convert(url);
//Save the document
string filename = "Risk_Report" + DateTime.Now.ToString();
Session["filename"] = filename;
document.Save(filename+".pdf", HttpContext.Current.Response, HttpReadType.Save);
}
Need to remove the Div from the pdf that gets downloaded. Kindly assist.