Author: Peter Smith | Posted on: 3/27/2010 1:21:22 PM | Views : 285



Im generating a PDF file. Normally I send this to the user using a .ashx file, where the user can directly download it from his browser (see that code below).

Protected Function getfile() As MemoryStream

Dim stream As MemoryStream = New MemoryStream       
If document.PageCount > 0 Then
            document.Save(stream, False)
            'Context.Response.Clear()
            'Context.Response.ContentType = "application/pdf"
            'Context.Response.AddHeader("Content-disposition", "attachment;filename=TicketEZ_tickets_" + eventname + ".pdf")
            ...

Go to the complete details ...