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. PDF from database problem

PDF from database problem

Scheduled Pinned Locked Moved Web Development
databasehelpquestion
4 Posts 4 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.
  • W Offline
    W Offline
    WvdW
    wrote on last edited by
    #1

    Hi all, I have pdf help files in a SQL-DB that has to be displayed in a webpage. The code I wrote currently opens a blank page and only once you refresh the page does the pdf display Anny sugjestions? My code: if (Request.QueryString["ID"] != null) { String ID = Request.QueryString["ID"]; Help.HelpFile objHelpFile = new Help.HelpFile(new Guid(ID)); Response.ClearContent(); Response.ContentType = "application/pdf"; Response.BinaryWrite(objHelpFile.Data); Response.Flush(); Response.End(); }

    L C M 3 Replies Last reply
    0
    • W WvdW

      Hi all, I have pdf help files in a SQL-DB that has to be displayed in a webpage. The code I wrote currently opens a blank page and only once you refresh the page does the pdf display Anny sugjestions? My code: if (Request.QueryString["ID"] != null) { String ID = Request.QueryString["ID"]; Help.HelpFile objHelpFile = new Help.HelpFile(new Guid(ID)); Response.ClearContent(); Response.ContentType = "application/pdf"; Response.BinaryWrite(objHelpFile.Data); Response.Flush(); Response.End(); }

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      WvdW wrote:

      Anny sugjestions?

      I suggest you debug the application and see if anything obvious is occurring.

      1 Reply Last reply
      0
      • W WvdW

        Hi all, I have pdf help files in a SQL-DB that has to be displayed in a webpage. The code I wrote currently opens a blank page and only once you refresh the page does the pdf display Anny sugjestions? My code: if (Request.QueryString["ID"] != null) { String ID = Request.QueryString["ID"]; Help.HelpFile objHelpFile = new Help.HelpFile(new Guid(ID)); Response.ClearContent(); Response.ContentType = "application/pdf"; Response.BinaryWrite(objHelpFile.Data); Response.Flush(); Response.End(); }

        C Offline
        C Offline
        Curtis Schlak
        wrote on last edited by
        #3

        You may also want to use Mozilla Firefox with the Live HTTP Headers[^] to see if there's something missing or malformed in the initial response.

        "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty

        1 Reply Last reply
        0
        • W WvdW

          Hi all, I have pdf help files in a SQL-DB that has to be displayed in a webpage. The code I wrote currently opens a blank page and only once you refresh the page does the pdf display Anny sugjestions? My code: if (Request.QueryString["ID"] != null) { String ID = Request.QueryString["ID"]; Help.HelpFile objHelpFile = new Help.HelpFile(new Guid(ID)); Response.ClearContent(); Response.ContentType = "application/pdf"; Response.BinaryWrite(objHelpFile.Data); Response.Flush(); Response.End(); }

          M Offline
          M Offline
          Marc Firth
          wrote on last edited by
          #4

          I think i had this a while back - was due to a missing "Content-Transfer-Encoding = binary" header if I remember correctly...

          Neonlight

          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