In local system it working fine .We published and uploaded the site in server and getting the display as shown in below link
http://glenspark.info/Error/error.JPGThe message in the pdf display as shown below
"EO.Pdf.Internal.ky: This session is no longer valid. If you wish to reuse the session later, please consider calling GetCookies to retain the session cookies, then reuse these cookies through HtmlToPdfOptions.Cookies with another session."
print button click
protected void printdata(object sender, EventArgs e)
{
Session["url"] = "SalesListPrint.aspx?SalesFrom=" + TxtSalesFrom.Text + "&SalesTo=" + TxtSalesTo.Text + "&SalesNo=" + TxtSalesNo.Text;
ClientScript.RegisterStartupScript(this.GetType(), "onclick", "<script language=javascript>window.open('../PrintAsPdf.aspx','PrintMe','height=600px,width=600px,scrollbars=1');</script>");
}
PrintAsPdf.aspx page
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// our license key added here
PdfDocument doc = new PdfDocument();
string url = Request.Url.ToString();
string[] str = url.Split('?');
url = str[0].Replace("PrintAsPdf.aspx", Convert.ToString(Session["Url"]));
HtmlToPdf.ConvertUrl(url, doc);
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearHeaders();
response.ContentType = "application/pdf";
doc.Save(response.OutputStream);
}
}