Error while opening PDF
See the question and my original answer on StackOverflowIf your PDF is stored in a physical file, you don't need to use intermediary streams at all, just use the TransmitFile method which also has the benefit of not using .NET memory (in most cases):
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Content-Disposition", "inline");
Response.TransmitFile(your pdf path);