Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. lauch pdf file

lauch pdf file

Scheduled Pinned Locked Moved ASP.NET
help
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    srinandan
    wrote on last edited by
    #1

    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

    N S 2 Replies Last reply
    0
    • S srinandan

      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

      N Offline
      N Offline
      nikneem2005
      wrote on last edited by
      #2

      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[^]

      S 1 Reply Last reply
      0
      • S srinandan

        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

        S Offline
        S Offline
        Sylvester george
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • S Sylvester george

          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

          S Offline
          S Offline
          srinandan
          wrote on last edited by
          #4

          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

          S 1 Reply Last reply
          0
          • N nikneem2005

            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[^]

            S Offline
            S Offline
            srinandan
            wrote on last edited by
            #5

            thanks. lauch mean i have to provide the option to save or open the pfd file which will create from the byte[]. Srinandan

            1 Reply Last reply
            0
            • S srinandan

              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

              S Offline
              S Offline
              Sylvester george
              wrote on last edited by
              #6

              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

              S 1 Reply Last reply
              0
              • S Sylvester george

                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

                S Offline
                S Offline
                srinandan
                wrote on last edited by
                #7

                thanks i want to show download dialog box. but above code not show the pdf file in browser or otion like download srinandan

                S 1 Reply Last reply
                0
                • S srinandan

                  thanks i want to show download dialog box. but above code not show the pdf file in browser or otion like download srinandan

                  S Offline
                  S Offline
                  Sylvester george
                  wrote on last edited by
                  #8

                  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

                  S 1 Reply Last reply
                  0
                  • S Sylvester george

                    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

                    S Offline
                    S Offline
                    srinandan
                    wrote on last edited by
                    #9

                    Thanks Sylvester:laugh: great. Its working fine. Regards Srinandan

                    S 1 Reply Last reply
                    0
                    • S srinandan

                      Thanks Sylvester:laugh: great. Its working fine. Regards Srinandan

                      S Offline
                      S Offline
                      Sylvester george
                      wrote on last edited by
                      #10

                      You are most welcome. Please score it.

                      Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups