I need to open pdf in the new tab, it works and file show perfect, but if I open File with notepadd++, after EOF there are some NULL char (see pics).
It happen only I open it in new tab and use memorystream, the string after EOF create some problem the parser of client, whats wrong?.
This is code:
Dim mswithPage As New MemoryStream()
Dim SessValue As String = Request.QueryString("s")
Dim NOrder As String = Request.QueryString("odv")
mswithPage = CType(Session(SessValue), MemoryStream)
Response.Clear()
Response.ContentType = "Application/pdf"
Response.AddHeader("content-disposition", "inline;filename=" & NOrder & ".pdf")
Response.OutputStream.Write(mswithPage.GetBuffer(), 0, mswithPage.GetBuffer().Length)
Response.OutputStream.Flush()
Response.OutputStream.Close()
Response.End()