public IActionResult CreatePDFForPatients() { var globalSettings = new GlobalSettings { ColorMode = ColorMode.Color, Orientation = Orientation.Portrait, PaperSize = PaperKind.A4, Margins = new MarginSettings { Top = 10 }, DocumentTitle = "PDF Report", Out = $"D:\\Patients_Report_{DateTime.Now.Second.ToString()}.pdf" }; var objectSettings = new ObjectSettings { PagesCount = true, HtmlContent = TemplateGenerator.GetHTMLStringForPatients(_repo1.GetPatients().ToList()), WebSettings = { DefaultEncoding = "utf-8", UserStyleSheet = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Content", "styles.css") }, HeaderSettings = { FontName = "Arial", FontSize = 9, Right = "Страница [page] из [toPage]", Line = true }, FooterSettings = { FontName = "Arial", FontSize = 9, Line = true, Left = "Дата " + DateTime.Now.Date.ToShortDateString() } }; var pdf = new HtmlToPdfDocument() { GlobalSettings = globalSettings, Objects = { objectSettings } }; _converter.Convert(pdf); return(Ok("Отчет загружен в папку D")); }