try:
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/pdf"
Response.AddHeader("content-length", buffer.Length.ToString())
Response.AddHeader("content-disposition","inline;filename=report.pdf")
Response.BinaryWrite(buffer)
Response.End()
-- bruce (sqlwork.com)
> I am using the following code to stream a server generated pdf file to a
> client. Acrobat 7 opens the file as expected but Acrobat 5,6 and 8 launch
[quoted text clipped - 15 lines]
> Response.BinaryWrite(buffer)
> End If
gom - 10 Dec 2007 21:59 GMT
Tried it and it made the length mismatch smaller but still the same basic
problem.
> try:
>
[quoted text clipped - 29 lines]
>> Response.BinaryWrite(buffer)
>> End If
Peter Bromberg [C# MVP] - 11 Dec 2007 18:23 GMT
You need to examine the Response Stream (converted to text) to determine
exactly what is being added to the front of the response. Does the ASPX page
that generates this have anything besides the @Page Directive? If it does,
remove the offending markup.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
> Tried it and it made the length mismatch smaller but still the same basic
> problem.
[quoted text clipped - 31 lines]
> >> Response.BinaryWrite(buffer)
> >> End If