Error when exporting data to PDF from C#
<p>I am writing a PDF file from C# like this:</p>

<pre><code>Response.ContentType = "application/vnd.pdf";
Response.AddHeader("content-disposition", "attachment;filename=test.pdf");
Response.Write("&lt;table border='1px'&gt;");

/* Print Headers */
Response.Write("&lt;tr&gt;");
Response.Write("&lt;th colspan='" + colspan + "'style='background-color:SlateGray;font-size:16;height:25;color:white;'&gt;&lt;b&gt;List of Candidates  "&lt;/b&gt;&lt;/th&gt;");
Response.Write("&lt;/tr&gt;");
Response.Write("&lt;tr&gt;");
</code></pre>

<p>When I save the file and open it, it throws an exception that file is not supported file type .. or file has been damaged.</p>
