private void CreatePDF(object sender, WaitWindowEventArgs e) { //TODO: When audit log is exported and case notes are then exported (or vice-verca) as PDF, the application hangs... string path = e.Arguments[0].ToString(); string html = CaseNotesToHtml.CreateHtml(); HtmLtoPdf.SaveHtmltoPdf(html, "", "Case Notes", path); string hash = OsirtHelper.GetFileHash(path); Logger.Log(new OsirtActionsLog(Enums.Actions.CaseNotes, hash, System.IO.Path.GetFileName(path))); }
private void ExportAsPdf() { string page = DatatableToHtml.ConvertToHtml(GetMergedDataTable(), ExportPath, ReportContainerName); string save = HtmlHelper.ReplaceReportDetails(page, GSCP, false); HtmLtoPdf.SaveHtmltoPdf(save, GSCP, "audit log", Path.Combine(ExportPath, ReportContainerName, Constants.PdfReportName)); string hash = OsirtHelper.CreateHashForFolder(Path.Combine(ExportPath, ReportContainerName)); Logger.Log(new OsirtActionsLog(Enums.Actions.Report, hash, ReportContainerName)); PlaceReportInContainer(Path.Combine(ExportPath, ReportContainerName)); if (openReport) { Process.Start(Path.Combine(ExportPath, ReportContainerName, Constants.PdfReportName)); } }