0 Replies Latest reply on Nov 6, 2009 8:42 AM by JDarji

    Streaming PDF With Search Option

    JDarji

      Hi All,

       

      I want to open the Streamed PDF with Search Option.

      My PDF is searchable so if i use the URL like http://servername/abc.pdf#search=test then its working fine

       

      but when I stream the PDF then i m not able to pass the path like \\Servername\abc.pdf#search=test as it says that the file not found.

       

       

      Here is the code

       

        Response.Clear()
              Response.ContentType = "application/pdf"
              Response.AddHeader("Content-Disposition", "inline; filename=abc.pdf")
              Dim myStream As System.IO.Stream
              Dim buffer() As Byte
              Dim BytesRead As Integer
              myStream = New System.IO.FileStream("\\servername\new\abc.pdf", System.IO.FileMode.Open, _
                                                  IO.FileAccess.Read, IO.FileShare.Read)
              BuffSize = 102400
              Response.AddHeader("Content-Length", myStream.Length)
              ReDim buffer(BuffSize)
              BytesRead = myStream.Read(Buffer, 0, BuffSize)
              Do While (BytesRead > 0)
                  Response.OutputStream.Write(Buffer, 0, BytesRead)
                  Response.Flush()

       

                  BytesRead = myStream.Read(Buffer, 0, BuffSize)
              Loop
              Response.End()

       

      I want abc.pdf to be opened w/ search option but when i pass the seach option with the file name its not working.

       

      Is there any other way to Stream PDF with Search option?

       

      Regards

      JD