Do you mean the pdf is downloaded (returned to the browser) and the application associated with '.pdf' on your machine gives a message 'failed to load Pdf focument' ? - its a little unclear
I would :-
1) make sure you're generating a valid pdf - write it to disk for example and see if you can open it in anything that views pdf
2) I would have put the 'response closing' in this order - Im not sure if you need End() and Close() btw
Response.Flush();
Response.Close()
Response.End()
3) I would also add
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Before this line
Quote:
Response.ContentType = "application/pdf";
4) in all the examples Ive seen, Ive never seen this used
Quote:
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);