lauch pdf file
-
hi all:), i have need to get the pdf file from the byte[]. byte[] bytePdf = _objCashier.CreateRaiseCCLimitPDF("username"); now i have need to lounch the pdf file from the aspx page. please help. Thanks in advance Srinandan
What do you mean with 'launch' the pdf file?? Do you want to open it?? And do you want to open it server side, or client side?? I reckon you store the byte[] in a file and link to that file using a hyperlink...
I love it when a plan comes together http://www.zonderpunt.nl[^]
-
hi all:), i have need to get the pdf file from the byte[]. byte[] bytePdf = _objCashier.CreateRaiseCCLimitPDF("username"); now i have need to lounch the pdf file from the aspx page. please help. Thanks in advance Srinandan
Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "application/pdf"; Response.BinaryWrite(bytePdf); Response.Flush(); Response.End(); -- modified at 6:00 Wednesday 21st February, 2007
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "application/pdf"; Response.BinaryWrite(bytePdf); Response.Flush(); Response.End(); -- modified at 6:00 Wednesday 21st February, 2007
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
thanks sylveseter, here is the my code snippet: protected void btnDownloadForm_Click(object sender, EventArgs e) { //DataTable _dtRaiseDepositLevel = new DataTable(); //_dtRaiseDepositLevel = _objXmlHelper.getResult(_objCashier.CreateRaiseCCLimitPDF()); byte[] bytePdf = _objCashier.CreateRaiseCCLimitPDF(MerchantUser.UserName, MerchantUser.Password, (string)Session["Username"]); char[] charPdf = new char[bytePdf.Length]; Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "application/pdf"; Response.BinaryWrite(bytePdf); Response.Flush(); Response.End(); } bebugging goes successfully but i am unable to find the pdf file. pls tell me what wrong i am doing. Regards Srinandan
-
What do you mean with 'launch' the pdf file?? Do you want to open it?? And do you want to open it server side, or client side?? I reckon you store the byte[] in a file and link to that file using a hyperlink...
I love it when a plan comes together http://www.zonderpunt.nl[^]
-
thanks sylveseter, here is the my code snippet: protected void btnDownloadForm_Click(object sender, EventArgs e) { //DataTable _dtRaiseDepositLevel = new DataTable(); //_dtRaiseDepositLevel = _objXmlHelper.getResult(_objCashier.CreateRaiseCCLimitPDF()); byte[] bytePdf = _objCashier.CreateRaiseCCLimitPDF(MerchantUser.UserName, MerchantUser.Password, (string)Session["Username"]); char[] charPdf = new char[bytePdf.Length]; Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "application/pdf"; Response.BinaryWrite(bytePdf); Response.Flush(); Response.End(); } bebugging goes successfully but i am unable to find the pdf file. pls tell me what wrong i am doing. Regards Srinandan
you want to show download dialog or show the pdf in the browser?
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
you want to show download dialog or show the pdf in the browser?
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
thanks i want to show download dialog box. but above code not show the pdf file in browser or otion like download srinandan
FileStream fs = new FileStream(Server.MapPath("Filename.pdf"),FileMode.Create); BinaryWriter bw = new BinaryWriter(fs); bw.Write(bytePDF); fs.Close(); // Disable caching this page (C#) Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Buffer = true; Response.ContentType = "application/binary"; Response.AppendHeader("Content-Disposition: attachment; " + filename=Filename.pdf"); Response.WriteFile(Server.MapPath("Filename.pdf"); Response.End();
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
FileStream fs = new FileStream(Server.MapPath("Filename.pdf"),FileMode.Create); BinaryWriter bw = new BinaryWriter(fs); bw.Write(bytePDF); fs.Close(); // Disable caching this page (C#) Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Buffer = true; Response.ContentType = "application/binary"; Response.AppendHeader("Content-Disposition: attachment; " + filename=Filename.pdf"); Response.WriteFile(Server.MapPath("Filename.pdf"); Response.End();
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com
-
You are most welcome. Please score it.
Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com