This will not work. The response you are sending the browser is an HTML file, not a PDF. Setting
Response.ContentType
is not enough to produce the PDF.
You're going to want to look at a library such as
iTextSharp[
^]to create the PDF. You can then send the generated file in the response.