Hi,
After Downloading the PDF file the Current page not Refreshing.
already i have used the following code, but not working
Image PreviewImg = (Image)Session["CheckPreviewImage1"];
Document PDFPageSize = new Document(PageSize.A3);
string FileName = "Some FileName";
string path = Server.MapPath("PrintCheckPDFfiles") + "\\" + FileName + ".pdf"; ;
PdfWriter.GetInstance(PDFPageSize, new FileStream(path, FileMode.OpenOrCreate));
PDFPageSize.Open();
iTextSharp.text.Image pdfimg = iTextSharp.text.Image.GetInstance(PreviewImg, System.Drawing.Imaging.ImageFormat.Gif);
PDFPageSize.Add(pdfimg);
PDFPageSize.Close();
byte[] bytes = File.ReadAllBytes(path);
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ".pdf");
//Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(bytes);
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.End();
Response.Redirect("PageName.aspx");
for Refreshing the page after last line i used the above statement( Response.Redirect("PageName.aspx");)
After Downloading the PDF file the Current page not Refreshing.
already i have used the following code, but not working
Image PreviewImg = (Image)Session["CheckPreviewImage1"];
Document PDFPageSize = new Document(PageSize.A3);
string FileName = "Some FileName";
string path = Server.MapPath("PrintCheckPDFfiles") + "\\" + FileName + ".pdf"; ;
PdfWriter.GetInstance(PDFPageSize, new FileStream(path, FileMode.OpenOrCreate));
PDFPageSize.Open();
iTextSharp.text.Image pdfimg = iTextSharp.text.Image.GetInstance(PreviewImg, System.Drawing.Imaging.ImageFormat.Gif);
PDFPageSize.Add(pdfimg);
PDFPageSize.Close();
byte[] bytes = File.ReadAllBytes(path);
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName + ".pdf");
//Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(bytes);
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.End();
Response.Redirect("PageName.aspx");
for Refreshing the page after last line i used the above statement( Response.Redirect("PageName.aspx");)