Been searching for the past couple of days and haven\'t been able to find what I\'m looking for, hopefully I haven\'t missed it.
I have an ASP.NET (4.0) site that I\'m p
First, create a Generic Handler called GeneratePDF.ashx. Note I didn't write the below code and I'm not a VB.NET programmer, so I can't guarantee it'll work.
'generate bytes, perhaps based on Request.QueryString parameters
`write bytes to output
Response.Buffer = True
Response.Clear()
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "inline; filename=" & filename & "." & extension)
Response.BinaryWrite(bytes)
Response.Flush()
Then on our page, we use one of the techiques from the below link to embed the PDF, making sure to give the URL that points to our generic handler, and passing any parameters needed to generate the PDF via query string.
<embed src="GeneratePDF.ashx?parameter1=asdf¶meter2=qwer" width="500" height="375" type="application/pdf" />
Above code adapted from Recommended way to embed PDF in HTML?