public FileResult GetPDF() { //获取html模板 var htmlContent = TemplateGenerator.GetPDFHTMLString(); //生成PDF var pdfBytes = _PDFService.CreatePDF(htmlContent); return(File(pdfBytes, "application/pdf")); }