From d8ad91acde2aadb30cea98720d253808a53fe805 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Thu, 21 Mar 2024 21:11:04 +0100 Subject: [PATCH 1/3] added my files --- .gitignore | 5 +- .../Ghostscript.NET.DisplayTest.csproj | 8 +- .../Properties/Resources.Designer.cs | 28 +- .../Properties/Settings.Designer.cs | 10 +- Ghostscript.NET.DisplayTest/app.config | 13 +- .../Ghostscript.NET.Samples.csproj | 179 ++- .../Samples/FacturXWriteSample.cs | 59 + Ghostscript.NET.Samples/app.config | 17 +- Ghostscript.NET.Samples/packages.config | 23 + .../Ghostscript.NET.Viewer.csproj | 6 +- .../Properties/Resources.Designer.cs | 44 +- .../Properties/Settings.Designer.cs | 10 +- Ghostscript.NET.Viewer/app.config | 13 +- Ghostscript.NET/FacturX/PDFConverter.cs | 507 +++++++ Ghostscript.NET/FacturX/XMLTools.cs | 107 ++ .../FacturX/ZUGFeRD/BankDetails.cs | 102 ++ Ghostscript.NET/FacturX/ZUGFeRD/Contact.cs | 259 ++++ .../FacturX/ZUGFeRD/IExportableTransaction.cs | 422 ++++++ .../ZUGFeRD/IZUGFeRDExportableContact.cs | 101 ++ .../FacturX/ZUGFeRD/IZUGFeRDExportableItem.cs | 124 ++ .../ZUGFeRD/IZUGFeRDExportableProduct.cs | 114 ++ .../ZUGFeRD/IZUGFeRDExportableTradeParty.cs | 100 ++ .../FacturX/ZUGFeRD/IZUGFeRDPaymentTerms.cs | 16 + .../ZUGFeRD/IZUGFeRDTradeSettlement.cs | 25 + .../ZUGFeRD/IZUGFeRDTradeSettlementPayment.cs | 91 ++ Ghostscript.NET/FacturX/ZUGFeRD/Invoice.cs | 805 ++++++++++ Ghostscript.NET/FacturX/ZUGFeRD/Item.cs | 293 ++++ .../FacturX/ZUGFeRD/LineCalculator.cs | 91 ++ Ghostscript.NET/FacturX/ZUGFeRD/Product.cs | 174 +++ Ghostscript.NET/FacturX/ZUGFeRD/Profile.cs | 57 + Ghostscript.NET/FacturX/ZUGFeRD/Profiles.cs | 50 + Ghostscript.NET/FacturX/ZUGFeRD/TradeParty.cs | 288 ++++ .../FacturX/ZUGFeRD/TransactionCalculator.cs | 251 +++ Ghostscript.NET/FacturX/ZUGFeRD/VATAmount.cs | 103 ++ .../FacturX/ZUGFeRD/ZUGFeRD2PullProvider.cs | 527 +++++++ .../FacturX/ZUGFeRD/ZUGFeRDExporter.cs | 77 + .../FacturX/ZUGFeRD/ZUGFeRDImporter.cs | 1343 +++++++++++++++++ .../FacturX/assets/AdobeCompat-v2.icc | Bin 0 -> 374 bytes Ghostscript.NET/Ghostscript.NET.csproj | 155 +- Ghostscript.NET/PDFConverter.cs | 507 +++++++ Ghostscript.NET/app.config | 11 + Ghostscript.NET/packages.config | 12 + 42 files changed, 7066 insertions(+), 61 deletions(-) create mode 100644 Ghostscript.NET.Samples/Samples/FacturXWriteSample.cs create mode 100644 Ghostscript.NET.Samples/packages.config create mode 100644 Ghostscript.NET/FacturX/PDFConverter.cs create mode 100644 Ghostscript.NET/FacturX/XMLTools.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/BankDetails.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/Contact.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IExportableTransaction.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDExportableContact.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDExportableItem.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDExportableProduct.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDExportableTradeParty.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDPaymentTerms.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDTradeSettlement.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/IZUGFeRDTradeSettlementPayment.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/Invoice.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/Item.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/LineCalculator.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/Product.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/Profile.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/Profiles.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/TradeParty.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/TransactionCalculator.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/VATAmount.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRD2PullProvider.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRDExporter.cs create mode 100644 Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRDImporter.cs create mode 100644 Ghostscript.NET/FacturX/assets/AdobeCompat-v2.icc create mode 100644 Ghostscript.NET/PDFConverter.cs create mode 100644 Ghostscript.NET/app.config create mode 100644 Ghostscript.NET/packages.config diff --git a/.gitignore b/.gitignore index b9d6bd9..4cd339b 100644 --- a/.gitignore +++ b/.gitignore @@ -130,7 +130,7 @@ publish/ # NuGet Packages Directory ## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ +packages/ # Windows Azure Build Output csx @@ -213,3 +213,6 @@ pip-log.txt #Mr Developer .mr.developer.cfg + + +.vs/ \ No newline at end of file diff --git a/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj b/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj index af4c473..5c6891c 100644 --- a/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj +++ b/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj @@ -1,5 +1,5 @@  - + Debug x86 @@ -10,7 +10,7 @@ Properties Ghostscript.NET.DisplayTest Ghostscript.NET.DisplayTest - v4.0 + v4.8 512 @@ -32,6 +32,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -41,6 +42,7 @@ TRACE prompt 4 + false true @@ -51,6 +53,7 @@ prompt true true + false bin\x64\Release\ @@ -61,6 +64,7 @@ prompt true true + false diff --git a/Ghostscript.NET.DisplayTest/Properties/Resources.Designer.cs b/Ghostscript.NET.DisplayTest/Properties/Resources.Designer.cs index 6339ff3..fcf8bfd 100644 --- a/Ghostscript.NET.DisplayTest/Properties/Resources.Designer.cs +++ b/Ghostscript.NET.DisplayTest/Properties/Resources.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.18408 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ @@ -13,13 +13,13 @@ namespace Ghostscript.NET.DisplayTest.Properties { /// - /// A strongly-typed resource class, for looking up localized strings, etc. + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -33,7 +33,7 @@ internal Resources() { } /// - /// Returns the cached ResourceManager instance used by this class. + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Looks up a localized resource of type System.Drawing.Bitmap. + /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. /// internal static System.Drawing.Bitmap ghostscript_dotnet { get { diff --git a/Ghostscript.NET.DisplayTest/Properties/Settings.Designer.cs b/Ghostscript.NET.DisplayTest/Properties/Settings.Designer.cs index 27ef5da..67c2c32 100644 --- a/Ghostscript.NET.DisplayTest/Properties/Settings.Designer.cs +++ b/Ghostscript.NET.DisplayTest/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.18408 +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace Ghostscript.NET.DisplayTest.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Ghostscript.NET.DisplayTest/app.config b/Ghostscript.NET.DisplayTest/app.config index fcd0c93..f9833da 100644 --- a/Ghostscript.NET.DisplayTest/app.config +++ b/Ghostscript.NET.DisplayTest/app.config @@ -1,3 +1,12 @@ - + - + + + + + + + + + + diff --git a/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj b/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj index 953e0dd..c0bf447 100644 --- a/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj +++ b/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj @@ -1,5 +1,5 @@  - + Debug x86 @@ -10,7 +10,7 @@ Properties Ghostscript.NET.Samples Ghostscript.NET.Samples - v4.0 + v4.8 512 @@ -32,6 +32,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -41,6 +42,7 @@ TRACE prompt 4 + false true @@ -52,6 +54,7 @@ true true false + false bin\x64\Release\ @@ -63,14 +66,185 @@ true true false + false + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.AWT.WinForms.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Beans.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Charsets.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Cldrdata.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Corba.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Core.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Jdbc.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Localedata.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Management.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Media.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Misc.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Naming.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Nashorn.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Remoting.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Security.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.SwingAWT.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Text.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Tools.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Util.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.API.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Bind.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Crypto.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Parse.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Transform.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.WebServices.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.XPath.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.Runtime.dll + + + ..\packages\IKVM.8.1.5717.0\lib\IKVM.Runtime.JNI.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.barcodes.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.bouncy-castle-connector.dll + + + ..\packages\itext.commons.8.0.3\lib\net461\itext.commons.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.forms.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.io.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.kernel.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.layout.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.pdfa.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.pdfua.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.sign.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.styledxmlparser.dll + + + ..\packages\itext.8.0.3\lib\net461\itext.svg.dll + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Microsoft.Extensions.DependencyInjection.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Logging.5.0.0\lib\net461\Microsoft.Extensions.Logging.dll + + + ..\packages\Microsoft.Extensions.Logging.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\packages\Microsoft.Extensions.Options.5.0.0\lib\net461\Microsoft.Extensions.Options.dll + + + ..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll + + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\packages\OpenJDK.BigMathNET.1.0.2.1\lib\net40\OpenJDK.BigMathNET.dll + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + @@ -99,6 +273,7 @@ + \ No newline at end of file diff --git a/Ghostscript.NET.DisplayTest/Properties/AssemblyInfo.cs b/Ghostscript.NET.DisplayTest/Properties/AssemblyInfo.cs deleted file mode 100644 index bb7f9a4..0000000 --- a/Ghostscript.NET.DisplayTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Ghostscript.NET.DisplayTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Habjan")] -[assembly: AssemblyProduct("Ghostscript.NET.DisplayTest")] -[assembly: AssemblyCopyright("Copyright © 2013-2021 Josip Habjan (habjan@gmail.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6655d0b4-fdcb-4dd2-869f-82ed57d92951")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.3")] -[assembly: AssemblyFileVersion("1.2.3")] diff --git a/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj b/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj index c0bf447..e230dbb 100644 --- a/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj +++ b/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj @@ -1,19 +1,8 @@ - - + - Debug + net6.0 x86 - 8.0.30703 - 2.0 - {4C7B5A1E-2172-48A8-8139-5CB7A3D6065F} Exe - Properties - Ghostscript.NET.Samples - Ghostscript.NET.Samples - v4.8 - - - 512 @@ -22,265 +11,44 @@ + false + Ghostscript.NET.Samples + Habjan + Ghostscript.NET.Samples + Copyright © 2013-2021 Josip Habjan %28habjan%40gmail.com%29 + 1.2.3 + 1.2.3 x64 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - true bin\x64\Debug\ - DEBUG;TRACE - full - AnyCPU - prompt true true - false - false bin\x64\Release\ - TRACE - true - pdbonly - AnyCPU - prompt true true - false - false - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.AWT.WinForms.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Beans.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Charsets.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Cldrdata.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Corba.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Core.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Jdbc.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Localedata.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Management.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Media.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Misc.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Naming.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Nashorn.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Remoting.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Security.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.SwingAWT.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Text.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Tools.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Util.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.API.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Bind.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Crypto.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Parse.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Transform.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.WebServices.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.XPath.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.Runtime.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.Runtime.JNI.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.barcodes.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.bouncy-castle-connector.dll - - - ..\packages\itext.commons.8.0.3\lib\net461\itext.commons.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.forms.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.io.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.kernel.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.layout.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.pdfa.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.pdfua.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.sign.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.styledxmlparser.dll - - - ..\packages\itext.8.0.3\lib\net461\itext.svg.dll - - - ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Logging.5.0.0\lib\net461\Microsoft.Extensions.Logging.dll - - - ..\packages\Microsoft.Extensions.Logging.Abstractions.5.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll - - - ..\packages\Microsoft.Extensions.Options.5.0.0\lib\net461\Microsoft.Extensions.Options.dll - - - ..\packages\Microsoft.Extensions.Primitives.5.0.0\lib\net461\Microsoft.Extensions.Primitives.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\OpenJDK.BigMathNET.1.0.2.1\lib\net40\OpenJDK.BigMathNET.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - - ..\packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - - - ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll - - - ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - {8BDBDEEC-CAB1-4C0B-86C2-7B0D0D3FE363} - Ghostscript.NET - + - - + + + + + + + + + + + + + + - - \ No newline at end of file diff --git a/Ghostscript.NET.Samples/Properties/AssemblyInfo.cs b/Ghostscript.NET.Samples/Properties/AssemblyInfo.cs index 4a5c532..02fd22f 100644 --- a/Ghostscript.NET.Samples/Properties/AssemblyInfo.cs +++ b/Ghostscript.NET.Samples/Properties/AssemblyInfo.cs @@ -1,16 +1,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Ghostscript.NET.Samples")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Habjan")] -[assembly: AssemblyProduct("Ghostscript.NET.Samples")] -[assembly: AssemblyCopyright("Copyright © 2013-2021 Josip Habjan (habjan@gmail.com)")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -21,16 +11,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a9c22027-b799-4221-b8e0-58a94add72a6")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.3")] -[assembly: AssemblyFileVersion("1.2.3")] diff --git a/Ghostscript.NET.Samples/packages.config b/Ghostscript.NET.Samples/packages.config deleted file mode 100644 index 932a1a8..0000000 --- a/Ghostscript.NET.Samples/packages.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Ghostscript.NET.VS2019.sln b/Ghostscript.NET.VS2019.sln index 85564f9..14369e8 100644 --- a/Ghostscript.NET.VS2019.sln +++ b/Ghostscript.NET.VS2019.sln @@ -1,15 +1,15 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30907.101 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostscript.NET", "Ghostscript.NET\Ghostscript.NET.csproj", "{8BDBDEEC-CAB1-4C0B-86C2-7B0D0D3FE363}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET", "Ghostscript.NET\Ghostscript.NET.csproj", "{8BDBDEEC-CAB1-4C0B-86C2-7B0D0D3FE363}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostscript.NET.Samples", "Ghostscript.NET.Samples\Ghostscript.NET.Samples.csproj", "{4C7B5A1E-2172-48A8-8139-5CB7A3D6065F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET.Samples", "Ghostscript.NET.Samples\Ghostscript.NET.Samples.csproj", "{4C7B5A1E-2172-48A8-8139-5CB7A3D6065F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostscript.NET.DisplayTest", "Ghostscript.NET.DisplayTest\Ghostscript.NET.DisplayTest.csproj", "{3509F0F7-A7AD-4FEE-B388-AA817F3413E9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET.DisplayTest", "Ghostscript.NET.DisplayTest\Ghostscript.NET.DisplayTest.csproj", "{3509F0F7-A7AD-4FEE-B388-AA817F3413E9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ghostscript.NET.Viewer", "Ghostscript.NET.Viewer\Ghostscript.NET.Viewer.csproj", "{C099EB3A-B4D7-4379-AFAB-4FCD4DF4F003}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET.Viewer", "Ghostscript.NET.Viewer\Ghostscript.NET.Viewer.csproj", "{C099EB3A-B4D7-4379-AFAB-4FCD4DF4F003}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{3AA07E8A-8E52-4E60-A6BB-A5991B5F829F}" ProjectSection(SolutionItems) = preProject diff --git a/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj b/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj index 2184ea0..104e03c 100644 --- a/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj +++ b/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj @@ -1,19 +1,8 @@ - - + - Debug + net6.0-windows x86 - 8.0.30703 - 2.0 - {C099EB3A-B4D7-4379-AFAB-4FCD4DF4F003} WinExe - Properties - Ghostscript.NET.Viewer - Ghostscript.NET.Viewer - v4.8 - - - 512 @@ -22,82 +11,13 @@ - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false + false + true + true _res\Ghostscript.NET.Viewer.Icon.ico - - - - - - - - - - - Form - - - FDebug.cs - - - Form - - - FMain.cs - - - - - - FDebug.cs - - - FMain.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - @@ -110,17 +30,6 @@ - - {8BDBDEEC-CAB1-4C0B-86C2-7B0D0D3FE363} - Ghostscript.NET - + - - \ No newline at end of file diff --git a/Ghostscript.NET.Viewer/Properties/AssemblyInfo.cs b/Ghostscript.NET.Viewer/Properties/AssemblyInfo.cs deleted file mode 100644 index cf8bbe0..0000000 --- a/Ghostscript.NET.Viewer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Ghostscript.NET.Viewer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Habjan")] -[assembly: AssemblyProduct("Ghostscript.NET.Viewer")] -[assembly: AssemblyCopyright("Copyright © 2013-2021 Josip Habjan (habjan@gmail.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("49a5f948-aef2-46cf-a79e-e7c68e5f114b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.3")] -[assembly: AssemblyFileVersion("1.2.3")] diff --git a/Ghostscript.NET/FacturX/PDFConverter.cs b/Ghostscript.NET/FacturX/PDFConverter.cs index 2136a92..571072e 100644 --- a/Ghostscript.NET/FacturX/PDFConverter.cs +++ b/Ghostscript.NET/FacturX/PDFConverter.cs @@ -14,6 +14,8 @@ using Ghostscript.NET.Processor; using Microsoft.Extensions.FileProviders.Embedded; using Microsoft.Extensions.FileProviders; + +using Ghostscript.NET.FacturX.ZUGFeRD; /// /// ''' Klasse um per Ghostscript.net/Ghostscript beliebige PDFs in PDF/A-3 Dateien zu konvertieren diff --git a/Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRDImporter.cs b/Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRDImporter.cs index fed64d2..d7d7958 100644 --- a/Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRDImporter.cs +++ b/Ghostscript.NET/FacturX/ZUGFeRD/ZUGFeRDImporter.cs @@ -25,8 +25,8 @@ namespace Ghostscript.NET.FacturX.ZUGFeRD - using Item = org.mustangproject.Item; - using Product = org.mustangproject.Product; + using Item = Ghostscript.NET.FacturX.ZUGFeRD.Item; + using Product = Ghostscript.NET.FacturX.ZUGFeRD.Product; using Document = org.w3c.dom.Document; using Node = org.w3c.dom.Node; using NodeList = org.w3c.dom.NodeList; @@ -263,7 +263,6 @@ public bool FromPDF(string pPDFFile) return true; } - return false; } diff --git a/Ghostscript.NET/Ghostscript.NET.csproj b/Ghostscript.NET/Ghostscript.NET.csproj index f40fae5..bd63cb0 100644 --- a/Ghostscript.NET/Ghostscript.NET.csproj +++ b/Ghostscript.NET/Ghostscript.NET.csproj @@ -1,18 +1,13 @@ - - - + - Debug - AnyCPU - 8.0.30703 - 2.0 - {8BDBDEEC-CAB1-4C0B-86C2-7B0D0D3FE363} + net6.0 Library - Properties - Ghostscript.NET - Ghostscript.NET - v4.8 - 512 + enable + enable + true + true + true + @@ -21,58 +16,27 @@ - - - + false - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AnyCPU true - false bin\Debug\Ghostscript.NET.XML - pdbonly - true - bin\Release\ - TRACE - prompt - 4 true - AnyCPU - false bin\Release\Ghostscript.NET.xml - true bin\x64\Debug\ - DEBUG;TRACE true - full - AnyCPU - prompt false false - false bin\x64\Release\ - TRACE - true - pdbonly - AnyCPU - prompt false false true - false true @@ -82,229 +46,19 @@ false + Ghostscript.NET + Managed wrapper library around the Ghostscript native library %2832-bit & 64-bit%29, an interpreter for the PostScript language, PDF, related software and documentation. + Habjan + Ghostscript.NET + Copyright © 2013-2021 by Josip Habjan %28habjan%40gmail.com%29. All Rights Reserved. + 1.2.3 + 1.2.3 - - true - - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.AWT.WinForms.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Beans.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Charsets.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Cldrdata.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Corba.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Core.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Jdbc.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Localedata.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Management.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Media.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Misc.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Naming.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Nashorn.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Remoting.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Security.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.SwingAWT.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Text.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Tools.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.Util.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.API.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Bind.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Crypto.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Parse.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.Transform.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.WebServices.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.OpenJDK.XML.XPath.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.Runtime.dll - - - ..\packages\IKVM.8.1.5717.0\lib\IKVM.Runtime.JNI.dll - - - ..\packages\Microsoft.Extensions.FileProviders.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.FileProviders.Abstractions.dll - - - ..\packages\Microsoft.Extensions.FileProviders.Embedded.8.0.3\lib\net462\Microsoft.Extensions.FileProviders.Embedded.dll - - - ..\packages\Microsoft.Extensions.Primitives.8.0.0\lib\net462\Microsoft.Extensions.Primitives.dll - - - ..\packages\OpenJDK.BigMathNET.1.0.2.1\lib\net40\OpenJDK.BigMathNET.dll - - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - - ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll - - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". - - - - - - \ No newline at end of file diff --git a/Ghostscript.NET/PDFConverter.cs b/Ghostscript.NET/PDFConverter.cs deleted file mode 100644 index c94a9ad..0000000 --- a/Ghostscript.NET/PDFConverter.cs +++ /dev/null @@ -1,507 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Security; -using System.Text; -using System.Threading.Tasks; -using Microsoft.VisualBasic; -using System.Xml; -using Ghostscript.NET; -using Ghostscript.NET.Processor; -using Microsoft.Extensions.FileProviders.Embedded; -using Microsoft.Extensions.FileProviders; -namespace org.mustangproject; -/// - -/// ''' Klasse um per Ghostscript.net/Ghostscript beliebige PDFs in PDF/A-3 Dateien zu konvertieren - -/// ''' - -/// ''' -public class PDFConverter -{ - private string? file_GSDLL_DLL = null; - private readonly string? file_AdobeRGB1998_ICC = null; - private readonly string? file_BIGSCRIPT_PS = null; - - private readonly string resourceDir = Path.GetTempPath(); - private GhostscriptVersionInfo? gsVersion = null; - - protected string mPDFInFile = ""; // 08.06.20 - protected string mPDFOutFile = ""; - protected string? mXMLOutFile = null; - protected string FXVersion = "1.0"; - protected Profile usedProfile=Profiles.getByName("EN16931"); - - - /// - /// ''' Konstruktor mit Angabe Datenbankdatei, intern-nummer, KlassenID (und Gruppenpositionen) wenn ZUGFeRD geschrieben werden soll - /// ''' - /// ''' PDF-Eingabedatei - /// ''' PDF-A/3 Ausgabedatei - public PDFConverter(string pPDFInFile, string pPDFOutFile) - { - file_AdobeRGB1998_ICC = this.resourceDir+"\\AdobeCompat-v2.icc"; - file_BIGSCRIPT_PS = this.resourceDir+"\\pdfconvert.ps"; - - mPDFInFile = pPDFInFile; - mPDFOutFile = pPDFOutFile; - } - public PDFConverter setFXVersion(string pZFVersion) { - FXVersion = pZFVersion; - - return this; - } - public PDFConverter setFXProfile(Profile p) { - usedProfile = p; - - return this; - } - - - /// - /// ''' Erlaubt die Angabe einer einzubettenden XML-Datei. Die Ausgabe wird dann inkl. RDF-Metadaten und PDF/A-Schema Extension zur ZUGFeRD-Datei in der in - /// ''' pZFVersion angegebenen Version (2p0 fr 2.0, 2.0.1 sowie 2.1, 2.1.1) - /// ''' - /// ''' - /// ''' - public void EmbedXMLForZF(string pXMLOutFile, string pZFVersion) - { - mXMLOutFile = pXMLOutFile; - } - - - - public void prepareICC() - { - var embeddedProvider = new EmbeddedFileProvider(Assembly.GetExecutingAssembly()); - using (var reader = embeddedProvider.GetFileInfo("assets\\AdobeRGB1998.icc").CreateReadStream()) - { - byte[] data = new BinaryReader(reader).ReadBytes((int)reader.Length); - string tempfilename = Path.GetTempPath() + "AdobeRGB1998.icc"; - File.WriteAllBytes(tempfilename, data); - } - } - - - /// - /// ''' Schreibt eine Postscript-, genauer gesagt PDFMark-Datei die von Ghostscript interpretiert werden kann und mindestens in eine PDF-A/3 umwandelt - /// ''' - /// ''' - /// ''' ICC-Farbprofildatei bspw von https://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html - /// ''' - protected void WritePDFMark(string pEmbeddedAdobeRGB1998ICCFile) - { - string EscapedEmbeddedXMLFile = ""; - - if (mXMLOutFile != null) - { - if (!File.Exists(mXMLOutFile)) - { - throw new Exception("Datei " + mXMLOutFile + " existiert nicht"); - } - EscapedEmbeddedXMLFile = mXMLOutFile.Replace(@"\", @"\\"); // in PDFMark werden \ zu \\ gequoted - } - - - - if (!File.Exists(pEmbeddedAdobeRGB1998ICCFile)) - { - throw new Exception("Datei " + file_AdobeRGB1998_ICC + " existiert nicht"); - } - /* if (!pEmbeddedAdobeRGB1998ICCFile.Contains(Directory.GetCurrentDirectory())) - { - throw new Exception("Datei " + file_AdobeRGB1998_ICC + " muss unterhalb des absolut angegebenen Applikationspfades " + Directory.GetCurrentDirectory() + " liegen."); - } - */ - string EscapedEmbeddedICCFile = file_AdobeRGB1998_ICC.Replace(Directory.GetCurrentDirectory(), @".\").Replace(@"\", @"\\"); - - if (mPDFInFile == mPDFOutFile) - { - throw new Exception("Eingabedatei darf nicht Ausgabedatei sein"); - } - - string pdfMarkA3 = @"%! - -%Title - -[ /Title (Mustangproject.org .net) - /DOCINFO pdfmark - -% Define entries in the document Info dictionary : -/ICCProfile (" + EscapedEmbeddedICCFile + @") % Customise -def - -% Define an ICC profile : - -[/_objdef {icc_PDFA} /type /stream /OBJ pdfmark -[{icc_PDFA} -<< - /N currentpagedevice /ProcessColorModel known { - currentpagedevice /ProcessColorModel get dup /DeviceGray eq - {pop 1} { - /DeviceRGB eq - {3}{4} ifelse - } ifelse - } { - (ERROR, unable to determine ProcessColorModel) == flush - } ifelse ->> /PUT pdfmark - -[{icc_PDFA} ICCProfile (r) file /PUT pdfmark - -% Define the output intent dictionary : - -[/_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark -[{OutputIntent_PDFA} << - /Type /OutputIntent % Must be so (the standard requires). - /S /GTS_PDFA1 % Must be so (the standard requires). - /DestOutputProfile {icc_PDFA} % Must be so (see above). - /OutputConditionIdentifier (sRGB) % Customize ->> /PUT pdfmark - -[{Catalog} <> /PUT pdfmark -"; - - string PDFmark = pdfMarkA3; - if (mXMLOutFile != null) - { - // Dim myFile As New FileInfo(mXMLOutFile) - // Dim sizeInBytes As Long = myFile.Length - FileInfo fi = new FileInfo(mXMLOutFile); - long sizeInBytes = fi.Length; - - string rdfFXProfile="EN 16931"; - - string pfdMarkZugferd = @" - -% istring SimpleUTF16BE ostring -/SimpleUTF16BE -{ - dup length - 1 add - 2 mul - string - - % istring ostring - dup 0 16#FE put - dup 1 16#FF put - 2 - 3 -1 roll - - % ostring index istring - { - % ostring index ichar - 3 1 roll - % ichar ostring index - 2 copy 16#00 put - 1 add - 2 copy - 5 -1 roll - % ostring index ostring index ichar - put - 1 add - % ostring index - } - forall - - % ostring index - pop -} -bind def - -/XmlFileName (factur-x.xml) def -/XmlFileDesc (invoice) def -/XmlFileDate (D:" + DateTime.Now.ToString("yyyyMMddHHmmssK").Replace(":", "'") + @"') def -/XmlFileData (" + EscapedEmbeddedXMLFile + @") (r) file def - - - - % Object {ContentStream} anlegen und befllen - [ - /_objdef {ContentStream} - /type /stream - /OBJ pdfmark - - [ - {ContentStream} << - /Type /EmbeddedFile - /Subtype (text/xml) cvn - /Params << - /ModDate XmlFileDate - /Size " + sizeInBytes + @" - >> - >> - /PUT pdfmark - - [ - {ContentStream} XmlFileData - /PUT pdfmark - - [ - {ContentStream} - /CLOSE pdfmark - - % Object {FSDict} fr File Specification anlegen und befllen - [ - /_objdef {FSDict} - /type /dict - /OBJ pdfmark - - [ - {FSDict} << - /Type /FileSpec - /F XmlFileName - /UF XmlFileName SimpleUTF16BE - /Desc XmlFileDesc - /AFRelationship /Alternative - /EF << - /F {ContentStream} - /UF {ContentStream} - >> - >> - /PUT pdfmark - - % Object {AFArray} fr Associated Files anlegen und befllen - [ - /_objdef {AFArray} - /type /array - /OBJ pdfmark - - [ - {AFArray} {FSDict} - /APPEND pdfmark - - - - % Associated Files im Object {Catalog} eintragen - [ - {Catalog} << - /AF {AFArray} - >> - /PUT pdfmark - - - - % File Specification unter Names/Embedded Files/Names im Object {Catalog} eintragen - [ - /Name XmlFileName - /FS {FSDict} - /EMBED pdfmark - - % Metadata im Object {Catalog} eintragen - [ - /XML ( - - - - - Factur-x PDFA Extension Schema - urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0# - fx - - - - DocumentFileName - Text - external - Name of the embedded XML invoice file - - - DocumentType - Text - external - INVOICE - - - Version - Text - external - The actual version of the ZUGFeRD data - - - ConformanceLevel - Text - external - The conformance level of the ZUGFeRD data - - - - - - - - - - - INVOICE - factur-x.xml - " + FXVersion + @" - " + usedProfile.getXMPName() +@" - - - ) - /Ext_Metadata pdfmark"; - PDFmark += pfdMarkZugferd; - } - - - - UTF8Encoding utf8 = new UTF8Encoding(false); // kein BOM verwenden, s. https://docs.microsoft.com/de-de/dotnet/api/system.text.utf8encoding?view=netcore-3.1 - File.WriteAllBytes(file_BIGSCRIPT_PS, utf8.GetBytes(PDFmark)); - - } - - // - // Prft ob die Ausgabedatei beschrieben werden kann - // - public bool IsFileLocked(FileInfo file) - { - FileStream stream = (FileStream)null; - try - { - stream = file.Open(FileMode.Open, FileAccess.ReadWrite, FileShare.None); - } - catch (IOException generatedExceptionName) - { - // handle the exception your way - return true; - } - finally - { - if (stream != null) - stream.Close(); - } - return false; - } - - - /// - /// ''' Wandelt eine PDF-Datei (Dateiname in inputfile) in eine PDF A/3 (Outputfilename) um und hngt die aktuelle E-rechnung an - /// ''' - /// ''' True wenn die Konvertierung funktioniert hat - public bool ConvertToPDFA3(String gsdll) - { - - file_GSDLL_DLL=gsdll; - gsVersion = new GhostscriptVersionInfo(file_GSDLL_DLL); - - this.prepareICC(); - - // based on https://github.com/jhabjan/Ghostscript.NET/blob/master/Ghostscript.NET.Samples/Samples/ProcessorSample1.cs - if (!File.Exists(file_GSDLL_DLL)) - { - throw new Exception("Ghostscript DLL " + file_GSDLL_DLL + " bitte ins Verzeichnis " + Directory.GetCurrentDirectory() + " kopieren"); - - } - - if (!File.Exists(file_AdobeRGB1998_ICC)) - { - throw new Exception("Farbpprofile " + file_AdobeRGB1998_ICC + " bitte ins Verzeichnis " + Directory.GetCurrentDirectory() + " kopieren"); - - } - if (!File.Exists(mPDFInFile)) - { - throw new Exception("Eingabedatei " + mPDFInFile + " existiert nicht"); - - } - if (File.Exists(mPDFOutFile)) - { - if (FileSystem.GetAttr(mPDFOutFile) == Constants.vbReadOnly) - { - throw new Exception("Ausgabedatei " + mPDFOutFile + " keine Schreibrechte"); - - - } - FileInfo fi = new FileInfo(mPDFOutFile); - if (IsFileLocked(fi)) - { - throw new Exception("Ausgabedatei " + mPDFOutFile + " nicht beschreibbar (noch geffnet?)"); - - } - } - - // Info: braucht folgende DLLs: - // BouncyCastle.Crypto.dll, Common.Logging.Core.dll, Common.Logging.dll - // und: etliche, weitere der iText*.dll -> vorsichtshalber alle 9 kopiert - /* PdfDocument doc = new PdfDocument(new PdfReader(mPDFInFile)); - PdfAConformanceLevel comLev = doc.GetReader().GetPdfAConformanceLevel(); - if (comLev != null) - { - } - - */ - - - - WritePDFMark(file_AdobeRGB1998_ICC); - - // MsgBox(gsVersion.ToString) - GhostscriptLibrary gsL = null/* TODO Change to default(_) if this is not a reference type */; - // Dim gsL As GhostscriptLibrary = New GhostscriptLibrary(File.ReadAllBytes(ClsCommon.JS.StartupDir & ClsEDocs_Base.FixedValues.FILENAME_ZF_GSDLL32)) - gsL = new GhostscriptLibrary(gsVersion); - GhostscriptPipedOutput gsPipedOutput = new GhostscriptPipedOutput(); - - List switches = new List(); - // works : "C:\Program Files (x86)\gs\gs9.52\bin\gswin32c.exe" -dPDFA=1 -dNOOUTERSAVE -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -o RG_10690-pdfa.pdf -dPDFACompatibilityPolicy=1 "C:\Program Files (x86)\gs\gs9.52\lib\PDFA_def.ps" RG_10690.pdf - // "C:\Program Files (x86)\gs\gs9.52\bin\gswin64c.exe" -dPDFA=1 -dNOOUTERSAVE -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -o RG_10690-pdfa.pdf -dPDFACompatibilityPolicy=1 "C:\Program Files (x86)\gs\gs9.52\lib\PDFA_def.ps" RG_10690.pdf - switches.Add(""); // ' Der allererste Parameter wird mitunter ignoriert weil EXEs da ihren eigenen Namen bergeben bekommen - switches.Add("-P"); // Zugriff auf Ressourcen unterhalb des aktuellen Verzeichnisses erlauben - switches.Add("-dPDFA=3"); // 'in A/3 umwandeln Teil 1 von 3 - // switches.Add("-dCompressStreams=false") ''hatten mal Probleme weil scheinbar auch die XMP Metadaten von ZUGFeRD komprimiert wurden, das hat sich mittlerweile erledigt - switches.Add("-sColorConversionStrategy=RGB"); // ' muss fr PDF/A angegeben werden - switches.Add("-sDEVICE=pdfwrite"); // ' ein Device muss frs Rastern angegeben werden - switches.Add("-o" + mPDFOutFile); // ' Ausgabedatei - switches.Add("-dPDFACompatibilityPolicy=1"); // 'in A/3 umwandeln Teil 2 von 3 - switches.Add("-dRenderIntent=3"); // 'in A/3 umwandeln Teil 3 von 3 - switches.Add("-sGenericResourceDir=\"" + resourceDir + "/\""); // ' hier kann ein zustzliches Verzeichnis angegeben werden in dem Ressourcen wie die icc-Datei liegen drfen - switches.Add(file_BIGSCRIPT_PS); // ' die PDFMark-Programmdatei die interpretiert werden soll. Anders als die ICC und ggf. einzubettende XML-Datei ist das keine Ressourcendatei und die kann liegen wo sie will. - // siehe https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdfmark_reference.pdf - // und https://gitlab.com/crossref/pdfmark - switches.Add(mPDFInFile); // ' PDF-Eingabedatei - - bool success = false; - using (GhostscriptProcessor gsProcessor = new GhostscriptProcessor(gsL)) - { - VerboseMsgBoxOutput stdio = new VerboseMsgBoxOutput(); - // gsProcessor.StartProcessing(switches.ToArray(), stdio) - gsProcessor.StartProcessing(switches.ToArray(), null/* TODO Change to default(_) if this is not a reference type */); - - // (erfolglose) Versuche, das Hngen zu vermeiden... - gsProcessor.Dispose(); - } - success = true; - return success; - } - - // - // Zum Debuggen von Ghostscript ist es manchmal hilfreich, die Ausgabe in MsgBoxes umleiten zu knnen - // Bekannte Fehlercodes -100: Datei nicht gefunden oder nicht beschreibbar - // - public class VerboseMsgBoxOutput : GhostscriptStdIO - { - public VerboseMsgBoxOutput() : base(true, true, true) - { - } - - public override void StdOut(string output) - { - Console.Write("Out:" + output); - } - - public override void StdError(string error) - { - Console.Write("Error:" + error); - } - - public override void StdIn(out string input, int count) - { - input = "debug input"; - } - } -} diff --git a/Ghostscript.NET/Properties/AssemblyInfo.cs b/Ghostscript.NET/Properties/AssemblyInfo.cs index 6fbe3af..8d83b80 100644 --- a/Ghostscript.NET/Properties/AssemblyInfo.cs +++ b/Ghostscript.NET/Properties/AssemblyInfo.cs @@ -1,20 +1,9 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Ghostscript.NET")] -[assembly: AssemblyDescription("Managed wrapper library around the Ghostscript native library (32-bit & 64-bit), an interpreter for the PostScript language, PDF, related software and documentation.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Habjan")] -[assembly: AssemblyProduct("Ghostscript.NET")] -[assembly: AssemblyCopyright("Copyright © 2013-2021 by Josip Habjan (habjan@gmail.com). All Rights Reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("5b1fe89e-e040-4b7a-9c05-478c1756b6e8")] - - -[assembly: AssemblyVersion("1.2.3")] -[assembly: AssemblyFileVersion("1.2.3")] \ No newline at end of file diff --git a/Ghostscript.NET/packages.config b/Ghostscript.NET/packages.config deleted file mode 100644 index 9fc4e96..0000000 --- a/Ghostscript.NET/packages.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file From 2b7fc20ed3a9e51c82edae93546c00e58518388f Mon Sep 17 00:00:00 2001 From: Vincent Frebel Date: Mon, 2 Sep 2024 13:22:53 +0200 Subject: [PATCH 3/3] fixed PixelFormat compiling error --- .../Ghostscript.NET.DisplayTest.csproj | 12 ++-- .../Ghostscript.NET.Samples.csproj | 13 ++-- Ghostscript.NET.Samples/Program.cs | 61 +++++++++---------- Ghostscript.NET.VS2022.sln | 43 +++++++++++++ .../Ghostscript.NET.Viewer.csproj | 12 ++-- Ghostscript.NET/Ghostscript.NET.csproj | 13 ++-- 6 files changed, 89 insertions(+), 65 deletions(-) create mode 100644 Ghostscript.NET.VS2022.sln diff --git a/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj b/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj index 9fb3c99..2b5ed86 100644 --- a/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj +++ b/Ghostscript.NET.DisplayTest/Ghostscript.NET.DisplayTest.csproj @@ -3,14 +3,10 @@ net6.0-windows x86 WinExe - - - - - - - - + + + + false true true diff --git a/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj b/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj index e230dbb..33842bb 100644 --- a/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj +++ b/Ghostscript.NET.Samples/Ghostscript.NET.Samples.csproj @@ -3,14 +3,10 @@ net6.0 x86 Exe - - - - - - - - + + + + false Ghostscript.NET.Samples Habjan @@ -46,7 +42,6 @@ - diff --git a/Ghostscript.NET.Samples/Program.cs b/Ghostscript.NET.Samples/Program.cs index b78352e..ce2dbe7 100644 --- a/Ghostscript.NET.Samples/Program.cs +++ b/Ghostscript.NET.Samples/Program.cs @@ -26,40 +26,37 @@ using System; using System.Collections.Generic; -using Ghostscript.NET.Viewer; +using Ghostscript.NET; +using Ghostscript.NET.Samples; -namespace Ghostscript.NET.Samples -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("Ghostscript.NET Samples"); - - if (!GhostscriptVersionInfo.IsGhostscriptInstalled) - { - throw new Exception("You don't have Ghostscript installed on this machine!"); - } +Console.WriteLine("Ghostscript.NET Samples"); - ISample sample; - - //sample = new GetInkCoverageSample(); - //sample = new ProcessorSample1(); - //sample = new ProcessorSample2(); - //sample = new FindInstalledGhostscriptVersionsSample(); - //sample = new RunMultipleInstancesSample(); - //sample = new ViewerSample(); - sample = new RasterizerSample1(); - //sample = new RasterizerSample2(); - //sample = new AddWatermarkSample(); - //sample = new DeviceUsageSample(); - //sample = new PipedOutputSample(); - //sample = new SendToPrinterSample(); - //sample = new RasterizerCropSample(); +if (!GhostscriptVersionInfo.IsGhostscriptInstalled) +{ + throw new Exception("You don't have Ghostscript installed on this machine!"); +} - sample.Start(); +List samples = new() +{ + //new GetInkCoverageSample(), + //new ProcessorSample1(), + //new ProcessorSample2(), + //new FindInstalledGhostscriptVersionsSample(), + //new RunMultipleInstancesSample(), + //new ViewerSample(), + //new RasterizerSample1(), + //new RasterizerSample2(), + //new AddWatermarkSample(), + //new DeviceUsageSample(), + //new PipedOutputSample(), + //new SendToPrinterSample(), + new FacturXWriteSample() +}; - Console.ReadLine(); - } - } +foreach (ISample sample in samples) +{ + sample.Start(); + Console.WriteLine($"Sample '{sample.GetType().Name}' run successful!"); } + +Console.ReadLine(); diff --git a/Ghostscript.NET.VS2022.sln b/Ghostscript.NET.VS2022.sln new file mode 100644 index 0000000..e4ae929 --- /dev/null +++ b/Ghostscript.NET.VS2022.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34928.147 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET", "Ghostscript.NET\Ghostscript.NET.csproj", "{C3553CA6-33AF-4137-A5C2-73D57A8DAF43}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET.DisplayTest", "Ghostscript.NET.DisplayTest\Ghostscript.NET.DisplayTest.csproj", "{FDB623A5-8362-47BA-9145-781B574962DA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET.Samples", "Ghostscript.NET.Samples\Ghostscript.NET.Samples.csproj", "{749F1BE2-A1BE-4C89-B94B-A2F1E38E03EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ghostscript.NET.Viewer", "Ghostscript.NET.Viewer\Ghostscript.NET.Viewer.csproj", "{194189A8-3558-4D92-9573-01BCAF85912F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C3553CA6-33AF-4137-A5C2-73D57A8DAF43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3553CA6-33AF-4137-A5C2-73D57A8DAF43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3553CA6-33AF-4137-A5C2-73D57A8DAF43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3553CA6-33AF-4137-A5C2-73D57A8DAF43}.Release|Any CPU.Build.0 = Release|Any CPU + {FDB623A5-8362-47BA-9145-781B574962DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDB623A5-8362-47BA-9145-781B574962DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDB623A5-8362-47BA-9145-781B574962DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDB623A5-8362-47BA-9145-781B574962DA}.Release|Any CPU.Build.0 = Release|Any CPU + {749F1BE2-A1BE-4C89-B94B-A2F1E38E03EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {749F1BE2-A1BE-4C89-B94B-A2F1E38E03EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {749F1BE2-A1BE-4C89-B94B-A2F1E38E03EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {749F1BE2-A1BE-4C89-B94B-A2F1E38E03EB}.Release|Any CPU.Build.0 = Release|Any CPU + {194189A8-3558-4D92-9573-01BCAF85912F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {194189A8-3558-4D92-9573-01BCAF85912F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {194189A8-3558-4D92-9573-01BCAF85912F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {194189A8-3558-4D92-9573-01BCAF85912F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {51B9DE2F-D521-41F2-9AC0-DB8F8587A599} + EndGlobalSection +EndGlobal diff --git a/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj b/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj index 104e03c..a170316 100644 --- a/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj +++ b/Ghostscript.NET.Viewer/Ghostscript.NET.Viewer.csproj @@ -3,14 +3,10 @@ net6.0-windows x86 WinExe - - - - - - - - + + + + false true true diff --git a/Ghostscript.NET/Ghostscript.NET.csproj b/Ghostscript.NET/Ghostscript.NET.csproj index bd63cb0..ba8b944 100644 --- a/Ghostscript.NET/Ghostscript.NET.csproj +++ b/Ghostscript.NET/Ghostscript.NET.csproj @@ -8,14 +8,10 @@ true true - - - - - - - - + + + + false @@ -59,6 +55,7 @@ + \ No newline at end of file