From a5073529cbbe0aee5bd5be51444d1b7342aef379 Mon Sep 17 00:00:00 2001 From: "hess.andrew" Date: Thu, 16 Mar 2023 14:25:30 +0100 Subject: [PATCH] 0.8.6 --- PDFProcessor/Properties/AssemblyInfo.cs | 4 +- README.md | 108 ++++++++++++------ SetupHelper/Properties/AssemblyInfo.cs | 4 +- clawPDF.Bridge/Properties/AssemblyInfo.cs | 4 +- clawPDF.Core/Properties/AssemblyInfo.cs | 4 +- clawPDF.Mail/Properties/AssemblyInfo.cs | 4 +- clawPDF.Settings/Properties/AssemblyInfo.cs | 4 +- clawPDF.Settings/clawPDFSettings.cs | 13 +++ clawPDF.Shared/Helper/URLs.cs | 9 +- clawPDF.Shared/Properties/AssemblyInfo.cs | 4 +- clawPDF.Utilities/Properties/AssemblyInfo.cs | 4 +- clawPDF/App.xaml.cs | 25 +++- clawPDF/Properties/AssemblyInfo.cs | 4 +- clawPDF/Startup/AppStartFactory.cs | 55 ++++++++- clawPDF/Views/AboutWindow.xaml | 9 +- clawPDF/Views/AboutWindow.xaml.cs | 5 + clawPDF/languages/Catalan (Catalan).ini | 2 +- clawPDF/languages/Catalan (Valencian).ini | 2 +- clawPDF/languages/Chinese (Simplified).ini | 2 +- clawPDF/languages/Chinese (Traditional).ini | 2 +- clawPDF/languages/Corsican (France).ini | 2 +- clawPDF/languages/Czech.ini | 2 +- clawPDF/languages/Danish.ini | 2 +- clawPDF/languages/Dutch.ini | 2 +- clawPDF/languages/English.ini | 2 +- clawPDF/languages/Estonian.ini | 2 +- clawPDF/languages/Finnish.ini | 2 +- clawPDF/languages/French.ini | 2 +- clawPDF/languages/Gaelic (Scotland).ini | 2 +- clawPDF/languages/German.ini | 2 +- clawPDF/languages/Hungarian.ini | 2 +- clawPDF/languages/Italian.ini | 2 +- clawPDF/languages/Lithuanian.ini | 2 +- .../languages/Norwegian, Bokmal (Norway).ini | 2 +- clawPDF/languages/Polish.ini | 2 +- clawPDF/languages/Portuguese (Brazil).ini | 2 +- clawPDF/languages/Russian.ini | 2 +- clawPDF/languages/Slovenian.ini | 2 +- clawPDF/languages/Spanish.ini | 2 +- clawPDF/languages/Swedish.ini | 2 +- ftplib/Properties/AssemblyInfo.cs | 4 +- 41 files changed, 210 insertions(+), 102 deletions(-) diff --git a/PDFProcessor/Properties/AssemblyInfo.cs b/PDFProcessor/Properties/AssemblyInfo.cs index c2384a1e..ae1f5f9e 100644 --- a/PDFProcessor/Properties/AssemblyInfo.cs +++ b/PDFProcessor/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] \ No newline at end of file diff --git a/README.md b/README.md index 5d11929e..e7dfd426 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,84 @@ Yet another PDF Printer? Yes! This PDF Printer has the intention to be completely open source.

Open Source virtual PDF printer for Windows 7 / 8 / 10 / 11 / RDS / Terminalserver
-Print to PDF, PDF/A, PDF/X, PNG, JPEG, TIF and text +Print to PDF, PDF/A, PDF/X, PNG, JPEG, TIF and TXT # Download -https://github.com/clawsoftware/clawPDF/releases/download/0.8.5/clawPDF_0.8.5_setup.msi +https://github.com/clawsoftware/clawPDF/releases/download/0.8.6/clawPDF_0.8.6_setup.msi + + +# Features + +- Print to PDF, PDF/A, PDF/X, PNG, JPEG, TIF and TXT +- Full unicode support +- Multiple profiles +- Post Actions +- Create additional printers with assigned profile +- 24 languages +- Many settings +- Easy to use +- Easy to deploy (MSI-Installer & Config) +- No adware, spyware, nagware +- ... # Tested under -- Windows RDS/Terminalserver +- Windows Server 2022 Terminalserver/RDS +- Windows Server 2019 Terminalserver/RDS +- Windows Server 2016 Terminalserver/RDS - Windows 11 x64 - Windows 10 x32/x64 - Windows 8 x32/x64 - Windows 7 x32/x64 +# Commandline + +## Batch Printing +``` +The GUID for the Profile parameter is located under: HKEY_CURRENT_USER\Software\clawSoft\clawPDF\Settings\ConversionProfiles\[id]\Guid + +clawPDF.exe /PrintFile=D:\example.docx /profile=f81ea998-3a76-4104-a574-9a66d6f3039b +clawPDF.exe /PrintFile=D:\example.pdf /profile=JpegGuid + +clawPDF.exe /PrintFile=D:\example.txt /printerName=clawPDF2 +clawPDF.exe /PrintFile=D:\example.docx /printerName=clawJPG +``` + +## Overwrite Config +``` +- To deploy a default configuration in an enterprise environment. +- To export a configuration select "Application Settings -> Debug -> Save settings to file". + +clawPDF.exe /Config=D:\clawPDF.ini +``` + +## Printer Managment +``` +SetupHelper.exe /Printer=Add /Name=ExamplePrinter +SetupHelper.exe /Printer=Remove /Name=ExamplePrinter +``` + +## ManagePrintJobs +``` +clawPDF.exe /ManagePrintJobs +``` + # Changelog +## v0.8.6 (2023.03.16) + +- [feature] Profile Settings -> Actions -> Run Script -> Hide the process execution +- [feature] Config parameter e.g. to deploy settings in enterprise environments +- [bugfix] Unicode support in usernames +- [bugfix] Printing is now working for ghostscript parameters with east-asian characters +- [bugfix] Profiles for additional printers work now (Application Settings -> Printers -> Profile) +- [misc] Optimizations for Windows Remote Desktop + ## v0.8.5 (2023.03.11) -- [update] Update to GS10 +- [update] Update to Ghostscript 10 - [bugfix] MapiClient (thx to christian1980nrw) - [bugfix] FtpConnection (thx to droshcom) - [bugfix] Typo Czech.ini (thx to PetrTodorov) @@ -32,48 +90,22 @@ https://github.com/clawsoftware/clawPDF/releases/download/0.8.5/clawPDF_0.8.5_se ## v0.8.4 (2019.06.11) -- [bugfix] unicode filename support (thx to daooze for bugreport) +- [bugfix] Unicode filename support (thx to daooze for bugreport) ## v0.8.3 (2019.05.31) -- [bugfix] starts under System-Account -- [cleanup] migrated code from c++ to c# -- [update] ghostscript 9.27 -- [bugfix] author metadata +- [bugfix] Starts under System-Account +- [cleanup] Migrated code from c++ to c# +- [update] Ghostscript 9.27 +- [bugfix] Author metadata -## v0.8.01 (2019.02.10) +## v0.8.1 (2019.02.10) -- [bugfix] performance boost for RDS environments +- [bugfix] Performance boost for RDS environments ## v0.8.0 (2019.02.10) -- initial version - - -# Features - -- print to PDF, PDF/A, PDF/X, PNG, JPEG, TIF and text -- 24 languages -- many settings -- easy to use -- easy to deploy (MSI-Installer) -- no adware, spyware, nagware -- ... - - -# Commandline - -## Batch Printing - -- clawPDF.exe /PrintFile=D:\example.docx /profile=f81ea998-3a76-4104-a574-9a66d6f3039b -- clawPDF.exe /PrintFile=D:\example.pdf /profile=JpegGuid - -/profile=GUID (HKEY_CURRENT_USER\Software\clawSoft\clawPDF\Settings\ConversionProfiles\id\Guid) - - -## ManagePrintJobs - -- clawPDF.exe /ManagePrintJobs +- Initial version # Requirements diff --git a/SetupHelper/Properties/AssemblyInfo.cs b/SetupHelper/Properties/AssemblyInfo.cs index 1f4b83a8..48c68927 100644 --- a/SetupHelper/Properties/AssemblyInfo.cs +++ b/SetupHelper/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] \ No newline at end of file diff --git a/clawPDF.Bridge/Properties/AssemblyInfo.cs b/clawPDF.Bridge/Properties/AssemblyInfo.cs index 22b86b60..87182153 100644 --- a/clawPDF.Bridge/Properties/AssemblyInfo.cs +++ b/clawPDF.Bridge/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] \ No newline at end of file diff --git a/clawPDF.Core/Properties/AssemblyInfo.cs b/clawPDF.Core/Properties/AssemblyInfo.cs index 0202b94a..ed39bf22 100644 --- a/clawPDF.Core/Properties/AssemblyInfo.cs +++ b/clawPDF.Core/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] [assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/clawPDF.Mail/Properties/AssemblyInfo.cs b/clawPDF.Mail/Properties/AssemblyInfo.cs index 4965cbc8..09841f2e 100644 --- a/clawPDF.Mail/Properties/AssemblyInfo.cs +++ b/clawPDF.Mail/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] \ No newline at end of file diff --git a/clawPDF.Settings/Properties/AssemblyInfo.cs b/clawPDF.Settings/Properties/AssemblyInfo.cs index fdb7916e..90b53ffa 100644 --- a/clawPDF.Settings/Properties/AssemblyInfo.cs +++ b/clawPDF.Settings/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] \ No newline at end of file diff --git a/clawPDF.Settings/clawPDFSettings.cs b/clawPDF.Settings/clawPDFSettings.cs index 74a697bd..37815160 100644 --- a/clawPDF.Settings/clawPDFSettings.cs +++ b/clawPDF.Settings/clawPDFSettings.cs @@ -288,6 +288,19 @@ public bool LoadData(IStorage storage, string path, Action dataValidation) } } + public void LoadDataStart(IStorage storage, string path, Action dataValidation) + { + try + { + data.Clear(); + storage.SetData(data); + storage.ReadData(path); + dataValidation(data); + ReadValues(data, ""); + } + catch {} + } + // END_CUSTOM_SECTION:GENERAL // Custom Code ends here. Do not edit below } diff --git a/clawPDF.Shared/Helper/URLs.cs b/clawPDF.Shared/Helper/URLs.cs index fff7057e..0514d055 100644 --- a/clawPDF.Shared/Helper/URLs.cs +++ b/clawPDF.Shared/Helper/URLs.cs @@ -2,12 +2,7 @@ { public static class Urls { - public const string DonateUrl = "http://go.clawSoft.org/donate"; - public const string Facebook = "http://go.clawSoft.org/facebook"; - public const string GooglePlus = "http://go.clawSoft.org/google-plus"; - - public const string clawSoftWebsiteUrl = "http://www.clawSoft.org"; - - public const string clawPDFDownloadUrl = "http://go.clawSoft.org/clawPDF/download"; + public const string clawSoftWebsiteUrl = "https://github.com/clawsoftware/clawPDF"; + public const string clawSoftSponsorsUrl = "https://github.com/sponsors/clawsoftware"; } } \ No newline at end of file diff --git a/clawPDF.Shared/Properties/AssemblyInfo.cs b/clawPDF.Shared/Properties/AssemblyInfo.cs index d4f68ec4..c719018b 100644 --- a/clawPDF.Shared/Properties/AssemblyInfo.cs +++ b/clawPDF.Shared/Properties/AssemblyInfo.cs @@ -41,5 +41,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] \ No newline at end of file diff --git a/clawPDF.Utilities/Properties/AssemblyInfo.cs b/clawPDF.Utilities/Properties/AssemblyInfo.cs index dce3b001..78088d42 100644 --- a/clawPDF.Utilities/Properties/AssemblyInfo.cs +++ b/clawPDF.Utilities/Properties/AssemblyInfo.cs @@ -36,6 +36,6 @@ // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] [assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/clawPDF/App.xaml.cs b/clawPDF/App.xaml.cs index 6e14ebee..b873c1a7 100644 --- a/clawPDF/App.xaml.cs +++ b/clawPDF/App.xaml.cs @@ -5,12 +5,10 @@ using System.Windows; using System.Windows.Threading; using clawSoft.clawPDF.Assistants; -using clawSoft.clawPDF.Core.Ghostscript; using clawSoft.clawPDF.Core.Settings.Enums; using clawSoft.clawPDF.Helper; using clawSoft.clawPDF.Shared.Helper; using clawSoft.clawPDF.Shared.Helper.Logging; -using clawSoft.clawPDF.Shared.Views; using clawSoft.clawPDF.Startup; using clawSoft.clawPDF.Threading; using clawSoft.clawPDF.Utilities.Communication; @@ -52,13 +50,30 @@ private void App_OnStartup(object sender, StartupEventArgs e) } finally { - if (string.Join(" ", e.Args).Contains("INFODATAFILE")) + if (string.Join(" ", e.Args).ToLower().Contains("/printfile=")) { - string defaultProfile = RegistryUtility.ReadRegistryValue(@"Software\clawSoft\clawPDF\Batch", "DefaultProfileGuid"); + var defaultProfile = RegistryUtility.ReadRegistryValue(@"Software\clawSoft\clawPDF\Batch", "DefaultProfileGuid"); + if (!string.IsNullOrEmpty(defaultProfile)) { - RegistryUtility.WriteRegistryValue(@"Software\clawSoft\clawPDF\Settings\ApplicationSettings", "LastUsedProfileGuid", defaultProfile); + Thread.Sleep(5000); + var settings = SettingsHelper.Settings; + var printerDefaultProfileGuid = RegistryUtility.ReadRegistryValue(@"Software\clawSoft\clawPDF\Batch", "PrinterDefaultProfileGuid"); + var primaryPrinter = settings.ApplicationSettings.PrimaryPrinter; + settings.ApplicationSettings.LastUsedProfileGuid = defaultProfile; RegistryUtility.DeleteRegistryValue(@"Software\clawSoft\clawPDF\Batch", "DefaultProfileGuid"); + RegistryUtility.DeleteRegistryValue(@"Software\clawSoft\clawPDF\Batch", "PrinterDefaultProfileGuid"); + + foreach (var printer in settings.ApplicationSettings.PrinterMappings) + { + if (printer.PrinterName == primaryPrinter) + { + printer.ProfileGuid = printerDefaultProfileGuid; + } + } + + SettingsHelper.ApplySettings(settings); + SettingsHelper.SaveSettings(); } } globalMutex.Release(); diff --git a/clawPDF/Properties/AssemblyInfo.cs b/clawPDF/Properties/AssemblyInfo.cs index 05f1f574..392fb2e9 100644 --- a/clawPDF/Properties/AssemblyInfo.cs +++ b/clawPDF/Properties/AssemblyInfo.cs @@ -39,6 +39,6 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben -[assembly: AssemblyVersion("0.8.5.0")] -[assembly: AssemblyFileVersion("0.8.5.0")] +[assembly: AssemblyVersion("0.8.6.0")] +[assembly: AssemblyFileVersion("0.8.6.0")] [assembly: NeutralResourcesLanguage("")] \ No newline at end of file diff --git a/clawPDF/Startup/AppStartFactory.cs b/clawPDF/Startup/AppStartFactory.cs index bb8920a1..299f2521 100644 --- a/clawPDF/Startup/AppStartFactory.cs +++ b/clawPDF/Startup/AppStartFactory.cs @@ -1,9 +1,14 @@ -using System.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows; using clawSoft.clawPDF.Core.Settings; using clawSoft.clawPDF.Helper; using clawSoft.clawPDF.Utilities; using clawSoft.clawPDF.Utilities.Registry; using NLog; +using pdfforge.DataStorage.Storage; using SystemInterface.IO; using SystemWrapper.IO; @@ -13,6 +18,7 @@ internal class AppStartFactory { private readonly ApplicationSettings _appSettings; private readonly Logger _logger = LogManager.GetCurrentClassLogger(); + public Action UpdateSettings { get; set; } public AppStartFactory() : this(SettingsHelper.Settings.ApplicationSettings) { @@ -40,15 +46,46 @@ public IAppStart CreateApplicationStart(string[] commandLineArgs, IFile fileWrap var commandLineParser = new CommandLineParser(commandLineArgs); + if (commandLineParser.HasArgument("Config")) + { + Console.WriteLine("Load settings"); + var settings = SettingsHelper.CreateEmptySettings(); + var ini = new IniStorage(Encoding.UTF8); + var configFile = FindConfigParameter(commandLineParser); + settings.LoadDataStart(ini, configFile, SettingsHelper.UpgradeSettings); + SettingsHelper.ApplySettings(settings); + SettingsHelper.SaveSettings(); + return null; + } if (commandLineParser.HasArgument("PrintFile")) { + var settings = SettingsHelper.Settings; + var primaryPrinter = settings.ApplicationSettings.PrimaryPrinter; + var printerDefaultProfileGuid = ""; + var lastProfile = settings.ApplicationSettings.LastUsedProfileGuid; + var printFile = FindPrintFile(commandLineParser); var printerName = FindPrinterName(commandLineParser); var profileName = FindProfileParameter(commandLineParser); - string lastProfile = RegistryUtility.ReadRegistryValue(@"Software\clawSoft\clawPDF\Settings\ApplicationSettings", "LastUsedProfileGuid"); - RegistryUtility.WriteRegistryValue(@"Software\clawSoft\clawPDF\Batch", "DefaultProfileGuid", lastProfile); - RegistryUtility.WriteRegistryValue(@"Software\clawSoft\clawPDF\Settings\ApplicationSettings", "LastUsedProfileGuid", profileName); + + foreach (var printer in settings.ApplicationSettings.PrinterMappings) + { + if (printer.PrinterName == primaryPrinter) + { + printerDefaultProfileGuid = printer.ProfileGuid; + printer.ProfileGuid = ""; + } + } + + settings.ApplicationSettings.LastUsedProfileGuid = profileName; + + RegistryUtility.WriteRegistryValue(@"Software\clawSoft\clawPDF\Batch", "DefaultProfileGuid", lastProfile ?? ""); + RegistryUtility.WriteRegistryValue(@"Software\clawSoft\clawPDF\Batch", "PrinterDefaultProfileGuid", printerDefaultProfileGuid ?? ""); + + SettingsHelper.ApplySettings(settings); + SettingsHelper.SaveSettings(); + return new PrintFileStart(printFile, printerName); } @@ -66,7 +103,7 @@ private static bool ShouldCallInitialize(CommandLineParser commandLineParser) if (!commandLineParser.HasArgument("InitializeSettings")) return false; - var excludingArguments = new[] { "ManagePrintJobs", "InfoDataFile", "PsFile", "PdfFile" }; + var excludingArguments = new[] { "ManagePrintJobs", "InfoDataFile", "PsFile", "PdfFile", "Config" }; return excludingArguments.All(argument => !commandLineParser.HasArgument(argument)); } @@ -165,5 +202,13 @@ private string FindProfileParameter(CommandLineParser commandLineParser) return ""; } + + private string FindConfigParameter(CommandLineParser commandLineParser) + { + if (commandLineParser.HasArgument("Config")) + return commandLineParser.GetArgument("Config"); + + return ""; + } } } \ No newline at end of file diff --git a/clawPDF/Views/AboutWindow.xaml b/clawPDF/Views/AboutWindow.xaml index ab26c0c4..55ce2752 100644 --- a/clawPDF/Views/AboutWindow.xaml +++ b/clawPDF/Views/AboutWindow.xaml @@ -67,9 +67,12 @@ -