internal async Task GenerateXmlToPdfFile() { var timer = StatisticsTools.TimerFactory(); var directoryXMLPath = DirectoryDataFactory.CreateChildDirectory(this.fileList[0], $"xml{ DateTime.Now.ToString("ddHHmm")}"); var directoryPdfPath = DirectoryDataFactory.CreateChildDirectory(this.fileList[0], $"htmle{ DateTime.Now.ToString("ddHHmm")}"); await xml.TransformXML(this.fileList, this.fileXslt, directoryXMLPath); await pdf.CreatePdfFromHtmlFileAsync(DirectoryDataFactory.GetDirectoryFilesFromPath(directoryXMLPath), directoryPdfPath); DirectoryDataFactory.DeleteDirectory(directoryXMLPath); StatisticsTools.ShowTaskCompleted(timer); }
internal async void GenerateHtmlToPdfFile(Action <FileEventArgs> progressBarEventHandler) { var timing = StatisticsTools.TimerFactory(); pdf.eventHandler += progressBarEventHandler; try { await pdf.CreatePdfFromHtmlFileAsync(fileList); } catch (ProcessFileException ex) { MessageBox.Show($"Error in generating PDF file {Environment.NewLine} Current File:{ex.args.currentFileName}"); } StatisticsTools.ShowTaskCompleted(timing); }
internal async void GenerateSplitPdf(Action <FileEventArgs> progressBarEventHandler) { var timing = StatisticsTools.TimerFactory(); pdf.eventHandler += progressBarEventHandler; var timer = StatisticsTools.TimerFactory(); try { await pdf.SplitFile(this.fileList[0]); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } StatisticsTools.ShowTaskCompleted(timer); }