[ValidateInput(false)] // or throws HttpRequestValidationException
        public ActionResult Index(string xHtml)
        {
            Response.ContentType = "application/pdf";
            Response.AppendHeader(
                "Content-Disposition", "attachment; filename=test.pdf"
            );
            var simpleParser = new SimpleParser();
            simpleParser.Parse(Response.OutputStream, xHtml);

            return new EmptyResult();
        }
 // ConvertControlToPdf is a HtmlTable, used for brevity.
 // - HTML conversion for a GridView is **EXACTLY** the same
 protected void ProcessHtml(object sender, CommandEventArgs e)
 {
     Response.ContentType = "application/pdf";
     Response.AppendHeader("Content-Disposition", "attachment; filename=test.pdf");
     using (var stringWriter = new StringWriter())
     {
         using (var htmlWriter = new HtmlTextWriter(stringWriter))
         {
             ConvertControlToPdf.RenderControl(htmlWriter);
         }
         var simpleParser = new SimpleParser();
         simpleParser.Parse(Response.OutputStream, stringWriter.ToString());
     }
     Response.End();
 }