return / pdf download from backend to ajax

0

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");

    }
    
asked by anonymous 06.02.2018 / 16:53

0 answers