From d16fdfdf844cfe896311376e6faf57ffe597c226 Mon Sep 17 00:00:00 2001 From: Berat ARPA Date: Mon, 6 Jan 2025 08:11:58 +0300 Subject: [PATCH] New Update Commit: 1.Fixed the issue where formatting HTML caused it to break. 2.Added ignoreCase support for tags, allowing usage of or interchangeably. 3.Application errors and UI have been translated into English. 4.The algorithm for creating justified tables has been rewritten. 5.Several minor changes were made. --- PrintHTML/Helpers/AsyncPrintTask.cs | 6 +- PrintHTML/MainWindow.xaml | 34 ++- PrintHTML/MainWindow.xaml.cs | 61 +++-- PrintHTML/PrintHTML.csproj | 4 +- ...tFormatter.cs => HtmlFormattedDocument.cs} | 214 ++++++++++-------- ...tmlPrinterService.cs => PrinterService.cs} | 98 ++++---- 6 files changed, 237 insertions(+), 180 deletions(-) rename PrintHTML/Services/{DocumentFormatter.cs => HtmlFormattedDocument.cs} (50%) rename PrintHTML/Services/{HtmlPrinterService.cs => PrinterService.cs} (61%) diff --git a/PrintHTML/Helpers/AsyncPrintTask.cs b/PrintHTML/Helpers/AsyncPrintTask.cs index f31c21d..4538ebc 100644 --- a/PrintHTML/Helpers/AsyncPrintTask.cs +++ b/PrintHTML/Helpers/AsyncPrintTask.cs @@ -22,12 +22,12 @@ public static void Exec(bool highPriority, Action action) private static void InternalExec(Action action) { try - { + { action.Invoke(); } - catch (Exception e) + catch (Exception exception) { - MessageBox.Show(e.Message); + MessageBox.Show($"There is a problem while printing.\n\nError Message: {exception.Message}"); } } } diff --git a/PrintHTML/MainWindow.xaml b/PrintHTML/MainWindow.xaml index 6cd8101..bab8cbe 100644 --- a/PrintHTML/MainWindow.xaml +++ b/PrintHTML/MainWindow.xaml @@ -1,7 +1,8 @@  + Title="Flexible Print Application" Height="600" Width="800" WindowStartupLocation="CenterScreen"> + @@ -9,31 +10,42 @@ - + + + + - - + - + - - + Text="<div style="text-align: center; color: red;">PRINT TEMPLATE USER GUIDE</div> <F>= <T>Text Alignment Examples: <L>This text is left-aligned <C>This text is centered <R>This text is right-aligned <F>= <T>Bold Text Examples: <EB> This text will be bold <DB> <F>= <T>Table Example: <J>Product | Stock <J>Laptop | 25 <J>Mouse | 100 <J>Keyboard | 50 <F>= <C>beratarpa.com"/> + + + + -