I am converting an html to pdf, I was able to generate in the backend the pdf with submit, but with ajax I can not download the pdf .. How can I handle in ajax to download?
Code:
[HttpPost]
[ValidateInput(false)]
public ActionResult Export(string htmlContent)
{
var htmlToPdf = new HtmlToPdfConverter();
var pdfContentType = "application/pdf";
return File(htmlToPdf.GeneratePdf(htmlContent, null), pdfContentType, "TituloArquivo"+ DateTime.Now.ToString("ddMMyyyyHHmmss")+".pdf");
}