0
votes

I am trying to save asp.net webpage response as pdf,but what it happens when i tried to open the generated pdf file,,it shows adobe reader could not open the file because it is either not a supported file or because the file has been damaged.

Here is the code i tried

**Response.ClearHeaders()

Response.AppendHeader("Content-disposition", String.Format("attachment;filename={0}", "Report.pdf"))

Response.ContentType = "application/pdf"**

Thanks.

1
Are you using iTextSharp to convert html to pfd?alessandro
Why not just navigate to the pdf? And let the user decide what to do with the pdf.Ryan Gates
I am not using ItextSharp, simply use the response by follow this link stackoverflow.com/questions/1072814/…Venkadesh Thirunamam

1 Answers

2
votes

You cannot simply set the response as pdf. You can use a library like itexsharp to get a pdf version of the web page http://sourceforge.net/projects/itextsharp/