I am writing a PDF file from C# like this:
Response.ContentType = "application/vnd.pdf";
Response.AddHeader("content-disposition", "attachment;filename=test.pdf");
Response.Write("<table border='1px'>");
/* Print Headers */
Response.Write("<tr>");
Response.Write("<th colspan='" + colspan + "'style='background-color:SlateGray;font-size:16;height:25;color:white;'><b>List of Candidates "</b></th>");
Response.Write("</tr>");
Response.Write("<tr>");
When I save the file and open it, it throws an exception that file is not supported file type .. or file has been damaged.