diff --git a/itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs b/itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs index f5e584c27f..a822a2fef2 100644 --- a/itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs +++ b/itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs @@ -18,6 +18,6 @@ [assembly: AssemblyFileVersion("7.1.15.0")] [assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")] -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [assembly: NUnit.Framework.Timeout(300000)] #endif diff --git a/itext.tests/itext.barcodes.tests/itext.barcodes.tests.netstandard.csproj b/itext.tests/itext.barcodes.tests/itext.barcodes.tests.netstandard.csproj index 8d403fd9a8..9e80744d4e 100644 --- a/itext.tests/itext.barcodes.tests/itext.barcodes.tests.netstandard.csproj +++ b/itext.tests/itext.barcodes.tests/itext.barcodes.tests.netstandard.csproj @@ -1,15 +1,18 @@ - + True False 4 - netcoreapp2.0;net40 + net5.0;netcoreapp2.0;net40 library + + library + Library NETSTANDARD2_0 @@ -45,12 +48,8 @@ - - - 15.0.0 - - - 4.3.0 - + + + \ No newline at end of file diff --git a/itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs b/itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs index 82365aaaca..0a08d634f0 100644 --- a/itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs +++ b/itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs @@ -18,6 +18,6 @@ [assembly: AssemblyFileVersion("7.1.15.0")] [assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")] -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [assembly: NUnit.Framework.Timeout(300000)] #endif diff --git a/itext.tests/itext.forms.tests/itext.forms.tests.netstandard.csproj b/itext.tests/itext.forms.tests/itext.forms.tests.netstandard.csproj index 8064ae1a64..c63dcd80de 100644 --- a/itext.tests/itext.forms.tests/itext.forms.tests.netstandard.csproj +++ b/itext.tests/itext.forms.tests/itext.forms.tests.netstandard.csproj @@ -5,11 +5,14 @@ 4 - netcoreapp2.0;net40 + net5.0;netcoreapp2.0;net40 library + + library + Library NETSTANDARD2_0 @@ -49,12 +52,8 @@ - - - 15.0.0 - - - 4.3.0 - - + + + + \ No newline at end of file diff --git a/itext.tests/itext.forms.tests/itext/forms/xfa/XXEVulnerabilityTest.cs b/itext.tests/itext.forms.tests/itext/forms/xfa/XXEVulnerabilityTest.cs index a5f64c575b..9d3de31434 100644 --- a/itext.tests/itext.forms.tests/itext/forms/xfa/XXEVulnerabilityTest.cs +++ b/itext.tests/itext.forms.tests/itext/forms/xfa/XXEVulnerabilityTest.cs @@ -66,7 +66,7 @@ public virtual void XfaExternalFileTest() { String outFileName = destinationFolder + "outXfaExternalFile.pdf"; String cmpFileName = sourceFolder + "cmp_outXfaExternalFile.pdf"; -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 using (PdfDocument pdfDoc = new PdfDocument(new PdfReader(inFileName), new PdfWriter(outFileName).SetCompressionLevel (CompressionConstants.NO_COMPRESSION))) { NUnit.Framework.Assert.That(() => @@ -98,7 +98,7 @@ public virtual void XfaExternalConnectionTest() { String outFileName = destinationFolder + "outXfaExternalConnection.pdf"; String cmpFileName = sourceFolder + "cmp_outXfaExternalConnection.pdf"; -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 using (PdfDocument pdfDoc = new PdfDocument(new PdfReader(inFileName), new PdfWriter(outFileName).SetCompressionLevel (CompressionConstants.NO_COMPRESSION))) { NUnit.Framework.Assert.That(() => diff --git a/itext.tests/itext.io.tests/Properties/AssemblyInfo.cs b/itext.tests/itext.io.tests/Properties/AssemblyInfo.cs index fd2a3e421c..5c393c5123 100644 --- a/itext.tests/itext.io.tests/Properties/AssemblyInfo.cs +++ b/itext.tests/itext.io.tests/Properties/AssemblyInfo.cs @@ -19,6 +19,6 @@ [assembly: AssemblyFileVersion("7.1.15.0")] [assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")] -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [assembly: NUnit.Framework.Timeout(300000)] #endif diff --git a/itext.tests/itext.io.tests/itext.io.tests.netstandard.csproj b/itext.tests/itext.io.tests/itext.io.tests.netstandard.csproj index 109dea282d..10f39a13d9 100644 --- a/itext.tests/itext.io.tests/itext.io.tests.netstandard.csproj +++ b/itext.tests/itext.io.tests/itext.io.tests.netstandard.csproj @@ -5,7 +5,7 @@ 4 - netcoreapp2.0;net40 + net5.0;netcoreapp2.0;net40 library @@ -52,6 +52,14 @@ 4.3.0 + + + 15.0.0 + + + 4.3.0 + + diff --git a/itext.tests/itext.kernel.tests/Properties/AssemblyInfo.cs b/itext.tests/itext.kernel.tests/Properties/AssemblyInfo.cs index 326514c1f6..a75c1386f0 100644 --- a/itext.tests/itext.kernel.tests/Properties/AssemblyInfo.cs +++ b/itext.tests/itext.kernel.tests/Properties/AssemblyInfo.cs @@ -19,6 +19,6 @@ [assembly: AssemblyFileVersion("7.1.15.0")] [assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")] -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [assembly: NUnit.Framework.Timeout(300000)] #endif diff --git a/itext.tests/itext.kernel.tests/itext.kernel.tests.netstandard.csproj b/itext.tests/itext.kernel.tests/itext.kernel.tests.netstandard.csproj index a02fca2a79..d205259e39 100644 --- a/itext.tests/itext.kernel.tests/itext.kernel.tests.netstandard.csproj +++ b/itext.tests/itext.kernel.tests/itext.kernel.tests.netstandard.csproj @@ -1,11 +1,11 @@ - + True False 4 - netcoreapp2.0;net40 + net5.0;netcoreapp2.0;net40 library diff --git a/itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfReaderTest.cs b/itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfReaderTest.cs index 41c7c9e223..635819ef23 100644 --- a/itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfReaderTest.cs +++ b/itext.tests/itext.kernel.tests/itext/kernel/pdf/PdfReaderTest.cs @@ -1193,7 +1193,7 @@ public virtual void IncorrectXrefSizeInTrailerAppend() { document.Close(); } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1213,7 +1213,7 @@ public virtual void StreamLengthCorrection1() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1230,7 +1230,7 @@ public virtual void StreamLengthCorrection2() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1247,7 +1247,7 @@ public virtual void StreamLengthCorrection3() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1264,7 +1264,7 @@ public virtual void StreamLengthCorrection4() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1281,7 +1281,7 @@ public virtual void StreamLengthCorrection5() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1298,7 +1298,7 @@ public virtual void StreamLengthCorrection6() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1315,7 +1315,7 @@ public virtual void StreamLengthCorrection7() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] @@ -1332,7 +1332,7 @@ public virtual void StreamLengthCorrection8() { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Timeout(1000)] #endif // !NETSTANDARD2_0 [NUnit.Framework.Test] diff --git a/itext.tests/itext.kernel.tests/itext/kernel/pdf/xobject/ImageFromLanguageStandardLibraryTest.cs b/itext.tests/itext.kernel.tests/itext/kernel/pdf/xobject/ImageFromLanguageStandardLibraryTest.cs index a1eb86955f..3af25a7e85 100644 --- a/itext.tests/itext.kernel.tests/itext/kernel/pdf/xobject/ImageFromLanguageStandardLibraryTest.cs +++ b/itext.tests/itext.kernel.tests/itext/kernel/pdf/xobject/ImageFromLanguageStandardLibraryTest.cs @@ -42,7 +42,7 @@ source product. */ // System.Drawing doesn't exist within .netcoreapp -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 using iText.Kernel.Font; using iText.Kernel.Pdf.Canvas; diff --git a/itext.tests/itext.kernel.tests/itext/kernel/xmp/impl/XMPMetaParserTest.cs b/itext.tests/itext.kernel.tests/itext/kernel/xmp/impl/XMPMetaParserTest.cs index 56f5404ce6..feaccb29e0 100644 --- a/itext.tests/itext.kernel.tests/itext/kernel/xmp/impl/XMPMetaParserTest.cs +++ b/itext.tests/itext.kernel.tests/itext/kernel/xmp/impl/XMPMetaParserTest.cs @@ -53,7 +53,7 @@ public class XMPMetaParserTest : ExtendedITextTest { + " \n" + " \n" + ""; -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Test] public virtual void XxeTestFromString() { String metadataToParse = MessageFormatUtil.Format(XMP_WITH_XXE, XXE_FILE_PATH); @@ -76,7 +76,7 @@ public virtual void XxeTestFromString() { } #endif // NETSTANDARD2_0 -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Test] public virtual void XxeTestFromByteBuffer() { String metadataToParse = MessageFormatUtil.Format(XMP_WITH_XXE, XXE_FILE_PATH); @@ -99,7 +99,7 @@ public virtual void XxeTestFromByteBuffer() { } #endif // NETSTANDARD2_0 -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 [NUnit.Framework.Test] public virtual void XxeTestFromInputStream() { String metadataToParse = MessageFormatUtil.Format(XMP_WITH_XXE, XXE_FILE_PATH); diff --git a/itext/itext.barcodes/itext.barcodes.netstandard.csproj b/itext/itext.barcodes/itext.barcodes.netstandard.csproj index b9b3f00938..2186a98c27 100644 --- a/itext/itext.barcodes/itext.barcodes.netstandard.csproj +++ b/itext/itext.barcodes/itext.barcodes.netstandard.csproj @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.barcodes/itext/barcodes/BarcodesExtensions.cs b/itext/itext.barcodes/itext/barcodes/BarcodesExtensions.cs index e76221f0a1..23e8833dbe 100644 --- a/itext/itext.barcodes/itext/barcodes/BarcodesExtensions.cs +++ b/itext/itext.barcodes/itext/barcodes/BarcodesExtensions.cs @@ -84,7 +84,7 @@ public static byte[] GetBytes(this String str) { } public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; diff --git a/itext/itext.font-asian/itext.font-asian.netstandard.csproj b/itext/itext.font-asian/itext.font-asian.netstandard.csproj index 6963029919..decad2f1c0 100644 --- a/itext/itext.font-asian/itext.font-asian.netstandard.csproj +++ b/itext/itext.font-asian/itext.font-asian.netstandard.csproj @@ -8,7 +8,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.forms/itext.forms.netstandard.csproj b/itext/itext.forms/itext.forms.netstandard.csproj index 1ba2dfd562..fd6d5e5737 100644 --- a/itext/itext.forms/itext.forms.netstandard.csproj +++ b/itext/itext.forms/itext.forms.netstandard.csproj @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.forms/itext/forms/FormsExtensions.cs b/itext/itext.forms/itext/forms/FormsExtensions.cs index a19521d718..f6a4178126 100644 --- a/itext/itext.forms/itext/forms/FormsExtensions.cs +++ b/itext/itext.forms/itext/forms/FormsExtensions.cs @@ -128,7 +128,7 @@ public static void Write(this Stream stream, byte[] buffer) { public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; diff --git a/itext/itext.hyph/itext.hyph.netstandard.csproj b/itext/itext.hyph/itext.hyph.netstandard.csproj index 6d91804272..f99c9beedd 100644 --- a/itext/itext.hyph/itext.hyph.netstandard.csproj +++ b/itext/itext.hyph/itext.hyph.netstandard.csproj @@ -7,7 +7,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.io/Properties/AssemblyInfo.cs b/itext/itext.io/Properties/AssemblyInfo.cs index 03b25c93b1..c0d4c3a5f7 100644 --- a/itext/itext.io/Properties/AssemblyInfo.cs +++ b/itext/itext.io/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ [assembly: Guid("39631ecb-1d39-4eb2-b775-37bd34cbf5a4")] -[assembly: AssemblyVersion("7.1.15.0")] -[assembly: AssemblyFileVersion("7.1.15.0")] -[assembly: AssemblyInformationalVersion("7.1.15-SNAPSHOT")] +[assembly: AssemblyVersion("7.2.0.0")] +[assembly: AssemblyFileVersion("7.2.0.0")] +[assembly: AssemblyInformationalVersion("7.2.0-SNAPSHOT")] diff --git a/itext/itext.io/itext.io.netstandard.csproj b/itext/itext.io/itext.io.netstandard.csproj index a5d1797c98..f40eaf5aa9 100644 --- a/itext/itext.io/itext.io.netstandard.csproj +++ b/itext/itext.io/itext.io.netstandard.csproj @@ -1,4 +1,4 @@ - + True False @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library @@ -81,9 +81,12 @@ - - + + + + + diff --git a/itext/itext.io/itext/io/IOExtensions.cs b/itext/itext.io/itext/io/IOExtensions.cs index 22cd37ddce..a8417fa111 100644 --- a/itext/itext.io/itext/io/IOExtensions.cs +++ b/itext/itext.io/itext/io/IOExtensions.cs @@ -197,7 +197,7 @@ public static T[] ToArray(this ICollection col) { } public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; diff --git a/itext/itext.io/itext/io/font/AdobeGlyphList.cs b/itext/itext.io/itext/io/font/AdobeGlyphList.cs index 6181de0b37..ff0ca61895 100644 --- a/itext/itext.io/itext/io/font/AdobeGlyphList.cs +++ b/itext/itext.io/itext/io/font/AdobeGlyphList.cs @@ -64,7 +64,7 @@ static AdobeGlyphList() { MemoryStream stream = new MemoryStream(); while (true) { int size = resource.Read(buf); - if (size < 0) { + if (size <= 0) { break; } stream.Write(buf, 0, size); diff --git a/itext/itext.io/itext/io/font/Type1Parser.cs b/itext/itext.io/itext/io/font/Type1Parser.cs index 784cd6da76..eb9ad5dc0f 100644 --- a/itext/itext.io/itext/io/font/Type1Parser.cs +++ b/itext/itext.io/itext/io/font/Type1Parser.cs @@ -90,7 +90,7 @@ public virtual RandomAccessFileOrArray GetMetricsFile() { } MemoryStream stream = new MemoryStream(); int read; - while ((read = resource.Read(buf)) >= 0) { + while ((read = resource.Read(buf)) > 0) { stream.Write(buf, 0, read); } buf = stream.ToArray(); diff --git a/itext/itext.io/itext/io/image/DrawingImageFactory.cs b/itext/itext.io/itext/io/image/DrawingImageFactory.cs index 434c9fccc6..e38e023038 100644 --- a/itext/itext.io/itext/io/image/DrawingImageFactory.cs +++ b/itext/itext.io/itext/io/image/DrawingImageFactory.cs @@ -1,4 +1,4 @@ -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 /* This file is part of the iText (R) project. diff --git a/itext/itext.io/itext/io/image/ImageDataFactory.cs b/itext/itext.io/itext/io/image/ImageDataFactory.cs index b5f62dc034..084a60919e 100644 --- a/itext/itext.io/itext/io/image/ImageDataFactory.cs +++ b/itext/itext.io/itext/io/image/ImageDataFactory.cs @@ -164,7 +164,7 @@ public static ImageData Create(int width, int height, int components, int bpc, b return image; } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 /// Gets an instance of an Image from a java.awt.Image /// the java.awt.Image to convert /// if different from null the transparency pixels are replaced by this color @@ -174,7 +174,7 @@ public static ImageData Create(System.Drawing.Image image, Color? color) { } #endif // !NETSTANDARD2_0 -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 /// Gets an instance of an Image from a java.awt.Image. /// the java.awt.Image to convert /// if different from null the transparency pixels are replaced by this color diff --git a/itext/itext.io/itext/io/util/AssemblyLoadContextUtil.cs b/itext/itext.io/itext/io/util/AssemblyLoadContextUtil.cs index 18bf56370a..43fa9c7a2c 100644 --- a/itext/itext.io/itext/io/util/AssemblyLoadContextUtil.cs +++ b/itext/itext.io/itext/io/util/AssemblyLoadContextUtil.cs @@ -48,7 +48,7 @@ source product. namespace iText.IO.Util { -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 /// This file is a helper class for internal usage only. /// /// This file is a helper class for internal usage only. diff --git a/itext/itext.io/itext/io/util/EncodingUtil.cs b/itext/itext.io/itext/io/util/EncodingUtil.cs index 72e1dbc8a7..b8ecf6c7df 100644 --- a/itext/itext.io/itext/io/util/EncodingUtil.cs +++ b/itext/itext.io/itext/io/util/EncodingUtil.cs @@ -54,7 +54,7 @@ namespace iText.IO.Util { public static class EncodingUtil { static EncodingUtil() { -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); #endif } diff --git a/itext/itext.io/itext/io/util/IntHashtable.cs b/itext/itext.io/itext/io/util/IntHashtable.cs index 9bfffcbf37..945bacc911 100644 --- a/itext/itext.io/itext/io/util/IntHashtable.cs +++ b/itext/itext.io/itext/io/util/IntHashtable.cs @@ -58,7 +58,7 @@ namespace iText.IO.Util { /// Bruno Lowagie (change Objects as keys into int values) /// Paulo Soares (added extra methods) public class IntHashtable -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 : ICloneable #endif { diff --git a/itext/itext.io/itext/io/util/ResourceUtil.cs b/itext/itext.io/itext/io/util/ResourceUtil.cs index f0a05afdb4..a54d3ec838 100644 --- a/itext/itext.io/itext/io/util/ResourceUtil.cs +++ b/itext/itext.io/itext/io/util/ResourceUtil.cs @@ -47,6 +47,10 @@ source product. using System.IO; using System.Linq; using System.Reflection; +#if NET5_0 +using System.Runtime.InteropServices; +using Microsoft.Extensions.DependencyModel; +#endif #if NETSTANDARD2_0 using Microsoft.DotNet.PlatformAbstractions; using Microsoft.Extensions.DependencyModel; @@ -123,7 +127,7 @@ public static Stream GetResourceStream(string key, Type definedClassType) { } } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { if (assembly.GetName().Name.StartsWith("itext")) { istr = SearchResourceInAssembly(key, assembly); @@ -135,7 +139,12 @@ public static Stream GetResourceStream(string key, Type definedClassType) { #else try { if (DependencyContext.Default != null) { - string runtimeId = RuntimeEnvironment.GetRuntimeIdentifier(); + string runtimeId = ""; +#if NET5_0 + runtimeId = RuntimeInformation.RuntimeIdentifier; +#else + runtimeId = RuntimeEnvironment.GetRuntimeIdentifier(); +#endif IEnumerable loadedAssemblies = DependencyContext.Default.GetRuntimeAssemblyNames(runtimeId).ToList(); foreach (AssemblyName assemblyName in loadedAssemblies) { if (assemblyName.Name.StartsWith("itext")) { @@ -151,7 +160,6 @@ public static Stream GetResourceStream(string key, Type definedClassType) { } } catch { } #endif - return istr; } @@ -170,7 +178,7 @@ private static Stream SearchResourceInAssembly(string key, Object obj) { string dir = (string)obj; try { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 istr = Assembly.LoadFrom(dir).GetManifestResourceStream(key); #else istr = AssemblyLoadContextUtil.LoadFromDefaultContextAssemblyPath(key).GetManifestResourceStream(key); @@ -204,7 +212,7 @@ private static Stream SearchResourceInAssembly(string key, Object obj) { } private static void LoadITextResourceAssemblies() { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 var loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where( a=> !a.IsDynamic).ToList(); List loadedPaths = new List(); foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) @@ -236,7 +244,12 @@ private static void LoadITextResourceAssemblies() { } } #else - string runtimeId = RuntimeEnvironment.GetRuntimeIdentifier(); + string runtimeId = ""; +#if NET5_0 + runtimeId = RuntimeInformation.RuntimeIdentifier; +#else + runtimeId = RuntimeEnvironment.GetRuntimeIdentifier(); +#endif List loadedAssemblies = null; try { loadedAssemblies = DependencyContext.Default?.GetRuntimeAssemblyNames(runtimeId).ToList(); diff --git a/itext/itext.kernel/KernelExtensions.cs b/itext/itext.kernel/KernelExtensions.cs index 02e687b3c0..c945bdb315 100644 --- a/itext/itext.kernel/KernelExtensions.cs +++ b/itext/itext.kernel/KernelExtensions.cs @@ -388,7 +388,7 @@ public static void Digest(this IDigest dgst, byte[] buff, int offest, int len) { dgst.DoFinal(buff, offest); } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 public static Attribute GetCustomAttribute(this Assembly assembly, Type attributeType) { object[] customAttributes = assembly.GetCustomAttributes(attributeType, false); if (customAttributes.Length > 0 && customAttributes[0] is Attribute) { @@ -400,14 +400,14 @@ public static Attribute GetCustomAttribute(this Assembly assembly, Type attribut #endif public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; #endif } -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 public static MethodInfo GetMethod(this Type type, String methodName, Type[] parameterTypes) { return type.GetTypeInfo().GetMethod(methodName, parameterTypes); } diff --git a/itext/itext.kernel/itext.kernel.netstandard.csproj b/itext/itext.kernel/itext.kernel.netstandard.csproj index 568a58fa58..854570490c 100644 --- a/itext/itext.kernel/itext.kernel.netstandard.csproj +++ b/itext/itext.kernel/itext.kernel.netstandard.csproj @@ -9,7 +9,7 @@ PORTABLE;NEW_REFLECTION - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.kernel/itext/kernel/geom/Point.cs b/itext/itext.kernel/itext/kernel/geom/Point.cs index 21095513a8..42ff9941d7 100644 --- a/itext/itext.kernel/itext/kernel/geom/Point.cs +++ b/itext/itext.kernel/itext/kernel/geom/Point.cs @@ -98,7 +98,7 @@ public virtual void Translate(double dx, double dy) { } public override int GetHashCode() { - HashCode hash = new HashCode(); + iText.IO.Util.HashCode hash = new iText.IO.Util.HashCode(); hash.Append(GetX()); hash.Append(GetY()); return hash.GetHashCode(); diff --git a/itext/itext.kernel/itext/kernel/pdf/filters/FlateDecodeFilter.cs b/itext/itext.kernel/itext/kernel/pdf/filters/FlateDecodeFilter.cs index cd7a890566..c8d3623a14 100644 --- a/itext/itext.kernel/itext/kernel/pdf/filters/FlateDecodeFilter.cs +++ b/itext/itext.kernel/itext/kernel/pdf/filters/FlateDecodeFilter.cs @@ -259,7 +259,7 @@ protected internal static byte[] FlateDecodeInternal(byte[] @in, bool strict, Me byte[] b = new byte[strict ? 4092 : 1]; try { int n; - while ((n = zip.Read(b)) >= 0) { + while ((n = zip.Read(b)) > 0) { @out.Write(b, 0, n); } zip.Dispose(); diff --git a/itext/itext.kernel/itext/kernel/xmp/XMPMeta.cs b/itext/itext.kernel/itext/kernel/xmp/XMPMeta.cs index ca3371882d..60f217017b 100644 --- a/itext/itext.kernel/itext/kernel/xmp/XMPMeta.cs +++ b/itext/itext.kernel/itext/kernel/xmp/XMPMeta.cs @@ -40,7 +40,7 @@ namespace iText.Kernel.XMP { /// /// 20.01.2006 public interface XMPMeta -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 : ICloneable #endif { diff --git a/itext/itext.layout/itext.layout.netstandard.csproj b/itext/itext.layout/itext.layout.netstandard.csproj index 3406f01a79..2d74a97f94 100644 --- a/itext/itext.layout/itext.layout.netstandard.csproj +++ b/itext/itext.layout/itext.layout.netstandard.csproj @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.layout/itext/layout/LayoutExtensions.cs b/itext/itext.layout/itext/layout/LayoutExtensions.cs index 7ad2417a22..16ffaf928c 100644 --- a/itext/itext.layout/itext/layout/LayoutExtensions.cs +++ b/itext/itext.layout/itext/layout/LayoutExtensions.cs @@ -229,14 +229,14 @@ public static T[] ToArray(this ICollection col) { } public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; #endif } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 public static Attribute GetCustomAttribute(this Assembly assembly, Type attributeType) { object[] customAttributes = assembly.GetCustomAttributes(attributeType, false); if (customAttributes.Length > 0 && customAttributes[0] is Attribute) { @@ -247,7 +247,7 @@ public static Attribute GetCustomAttribute(this Assembly assembly, Type attribut } #endif -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 public static MethodInfo GetMethod(this Type type, String methodName, Type[] parameterTypes) { return type .GetTypeInfo().GetMethod(methodName, parameterTypes); } diff --git a/itext/itext.layout/itext/layout/layout/LayoutArea.cs b/itext/itext.layout/itext/layout/layout/LayoutArea.cs index 671a5ca3bf..83f9bcc8e2 100644 --- a/itext/itext.layout/itext/layout/layout/LayoutArea.cs +++ b/itext/itext.layout/itext/layout/layout/LayoutArea.cs @@ -116,7 +116,7 @@ public override bool Equals(Object obj) { /// public override int GetHashCode() { - HashCode hashCode = new HashCode(); + iText.IO.Util.HashCode hashCode = new iText.IO.Util.HashCode(); hashCode.Append(pageNumber).Append(bBox.GetHashCode()); return hashCode.GetHashCode(); } diff --git a/itext/itext.pdfa/itext.pdfa.netstandard.csproj b/itext/itext.pdfa/itext.pdfa.netstandard.csproj index 1154d455b0..f45984542c 100644 --- a/itext/itext.pdfa/itext.pdfa.netstandard.csproj +++ b/itext/itext.pdfa/itext.pdfa.netstandard.csproj @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.pdfa/itext/pdfa/PdfAExtensions.cs b/itext/itext.pdfa/itext/pdfa/PdfAExtensions.cs index 6e84f4cb5d..6733041956 100644 --- a/itext/itext.pdfa/itext/pdfa/PdfAExtensions.cs +++ b/itext/itext.pdfa/itext/pdfa/PdfAExtensions.cs @@ -87,7 +87,7 @@ public static void RetainAll(this ISet set, ICollection c) { } public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; diff --git a/itext/itext.pdftest/itext.pdftest.netstandard.csproj b/itext/itext.pdftest/itext.pdftest.netstandard.csproj index 344d68785c..6fed44e18e 100644 --- a/itext/itext.pdftest/itext.pdftest.netstandard.csproj +++ b/itext/itext.pdftest/itext.pdftest.netstandard.csproj @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.pdftest/itext/test/PdfTestExtensions.cs b/itext/itext.pdftest/itext/test/PdfTestExtensions.cs index 155015af2e..984e4a6b3e 100644 --- a/itext/itext.pdftest/itext/test/PdfTestExtensions.cs +++ b/itext/itext.pdftest/itext/test/PdfTestExtensions.cs @@ -47,7 +47,7 @@ source product. namespace iText.Test { internal static class PdfTestExtensions { public static Attribute GetCustomAttribute(this Type classType, Type attributeType) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return Attribute.GetCustomAttribute(classType, attributeType); #else return classType.GetTypeInfo().GetCustomAttribute(attributeType); @@ -55,14 +55,14 @@ public static Attribute GetCustomAttribute(this Type classType, Type attributeTy } public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; #endif } -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 public static object[] GetCustomAttributes(this Type type, Type attributeType, bool inherit) { return type.GetTypeInfo().GetCustomAttributes(attributeType, inherit).ToArray(); } diff --git a/itext/itext.sign/itext.sign.netstandard.csproj b/itext/itext.sign/itext.sign.netstandard.csproj index 4870d8b931..26ea3c432d 100644 --- a/itext/itext.sign/itext.sign.netstandard.csproj +++ b/itext/itext.sign/itext.sign.netstandard.csproj @@ -6,7 +6,7 @@ 4 - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.sign/itext/signatures/AsymmetricAlgorithmSignature.cs b/itext/itext.sign/itext/signatures/AsymmetricAlgorithmSignature.cs index e6b879b7ea..5939b577d0 100644 --- a/itext/itext.sign/itext/signatures/AsymmetricAlgorithmSignature.cs +++ b/itext/itext.sign/itext/signatures/AsymmetricAlgorithmSignature.cs @@ -105,7 +105,7 @@ public AsymmetricAlgorithmSignature(RSACryptoServiceProvider algorithm, String h : this((AsymmetricAlgorithm) algorithm, hashAlgorithm) { } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 public AsymmetricAlgorithmSignature(DSACryptoServiceProvider algorithm) : this((AsymmetricAlgorithm) algorithm, null) { } @@ -117,7 +117,7 @@ private AsymmetricAlgorithmSignature(AsymmetricAlgorithm algorithm, String hashA if (algorithm is RSACryptoServiceProvider) encryptionAlgorithm = "RSA"; -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 else if (algorithm is DSACryptoServiceProvider) encryptionAlgorithm = "DSA"; #endif @@ -130,14 +130,15 @@ public byte[] Sign(byte[] message) { RSACryptoServiceProvider rsa = (RSACryptoServiceProvider) algorithm; return rsa.SignData(message, hashAlgorithm); } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 else { DSACryptoServiceProvider dsa = (DSACryptoServiceProvider) algorithm; return dsa.SignData(message); } #else - else { + else + { throw new ArgumentException("Not supported encryption algorithm " + algorithm); } #endif diff --git a/itext/itext.styledxmlparser/StyledXmlParserExtensions.cs b/itext/itext.styledxmlparser/StyledXmlParserExtensions.cs index 211ce82d61..547a4676c5 100644 --- a/itext/itext.styledxmlparser/StyledXmlParserExtensions.cs +++ b/itext/itext.styledxmlparser/StyledXmlParserExtensions.cs @@ -454,7 +454,7 @@ public static StringBuilder Reverse(this StringBuilder sb) { return sb; } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 public static Attribute GetCustomAttribute(this Assembly assembly, Type attributeType) { object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType, false); @@ -471,14 +471,14 @@ public static Attribute GetCustomAttribute(this Assembly assembly, Type attribut public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; #endif } -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 public static MethodInfo GetMethod(this Type type, String methodName, Type[] parameterTypes) { return type.GetTypeInfo().GetMethod(methodName, parameterTypes); } diff --git a/itext/itext.styledxmlparser/itext.styledxmlparser.netstandard.csproj b/itext/itext.styledxmlparser/itext.styledxmlparser.netstandard.csproj index cc10838628..1cdf525925 100644 --- a/itext/itext.styledxmlparser/itext.styledxmlparser.netstandard.csproj +++ b/itext/itext.styledxmlparser/itext.styledxmlparser.netstandard.csproj @@ -6,7 +6,7 @@ $(TargetDir)bin\$(Configuration)\$(TargetFramework)\itext.styledxmlparser.xml - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.styledxmlparser/itext/styledxmlparser/css/CssFontFaceRule.cs b/itext/itext.styledxmlparser/itext/styledxmlparser/css/CssFontFaceRule.cs index 459f141399..84e5b3359b 100644 --- a/itext/itext.styledxmlparser/itext/styledxmlparser/css/CssFontFaceRule.cs +++ b/itext/itext.styledxmlparser/itext/styledxmlparser/css/CssFontFaceRule.cs @@ -92,8 +92,8 @@ public override String ToString() { return sb.ToString(); } - public virtual Range ResolveUnicodeRange() { - Range range = null; + public virtual iText.Layout.Font.Range ResolveUnicodeRange() { + iText.Layout.Font.Range range = null; foreach (CssDeclaration descriptor in GetProperties()) { if ("unicode-range".Equals(descriptor.GetProperty())) { range = CssUtils.ParseUnicodeRange(descriptor.GetExpression()); diff --git a/itext/itext.styledxmlparser/itext/styledxmlparser/css/util/CssUtils.cs b/itext/itext.styledxmlparser/itext/styledxmlparser/css/util/CssUtils.cs index 267d1d520f..b78a5f0957 100644 --- a/itext/itext.styledxmlparser/itext/styledxmlparser/css/util/CssUtils.cs +++ b/itext/itext.styledxmlparser/itext/styledxmlparser/css/util/CssUtils.cs @@ -715,7 +715,7 @@ public static float[] ParseRgbaColor(String colorValue) { /// /// object /// - public static Range ParseUnicodeRange(String unicodeRange) { + public static iText.Layout.Font.Range ParseUnicodeRange(String unicodeRange) { String[] ranges = iText.IO.Util.StringUtil.Split(unicodeRange, ","); RangeBuilder builder = new RangeBuilder(); foreach (String range in ranges) { diff --git a/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Document.cs b/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Document.cs index 35bf5ecb41..017607cae9 100644 --- a/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Document.cs +++ b/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Document.cs @@ -479,10 +479,10 @@ public virtual Document QuirksMode(QuirksMode quirksMode) { /// A Document's output settings control the form of the text() and html() methods. public class OutputSettings -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 : ICloneable #endif - { + { private Entities.EscapeMode escapeMode = Entities.EscapeMode.@base; private System.Text.Encoding charset = EncodingUtil.GetEncoding("UTF-8"); diff --git a/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Node.cs b/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Node.cs index a3d3c080d8..4991937d75 100644 --- a/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Node.cs +++ b/itext/itext.styledxmlparser/itext/styledxmlparser/jsoup/nodes/Node.cs @@ -53,10 +53,10 @@ namespace iText.StyledXmlParser.Jsoup.Nodes { /// The base, abstract Node model. Elements, Documents, Comments etc are all Node instances. /// Jonathan Hedley, jonathan@hedley.net public abstract class Node -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 : ICloneable #endif - { + { private static readonly IList EMPTY_NODES = JavaCollectionsUtil.EmptyList (); diff --git a/itext/itext.svg/SvgExtensions.cs b/itext/itext.svg/SvgExtensions.cs index 0e0ace5e84..0ef2aa298a 100644 --- a/itext/itext.svg/SvgExtensions.cs +++ b/itext/itext.svg/SvgExtensions.cs @@ -406,7 +406,7 @@ public static StringBuilder Reverse(this StringBuilder sb) { return sb; } -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 public static Attribute GetCustomAttribute(this Assembly assembly, Type attributeType) { object[] customAttributes = Assembly.GetExecutingAssembly().GetCustomAttributes(attributeType, false); @@ -423,14 +423,14 @@ public static Attribute GetCustomAttribute(this Assembly assembly, Type attribut public static Assembly GetAssembly(this Type type) { -#if !NETSTANDARD2_0 +#if !NETSTANDARD2_0 && !NET5_0 return type.Assembly; #else return type.GetTypeInfo().Assembly; #endif } -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET5_0 public static MethodInfo GetMethod(this Type type, String methodName, Type[] parameterTypes) { return type.GetTypeInfo().GetMethod(methodName, parameterTypes); } diff --git a/itext/itext.svg/itext.svg.netstandard.csproj b/itext/itext.svg/itext.svg.netstandard.csproj index 6a6236125e..472e4f6a6d 100644 --- a/itext/itext.svg/itext.svg.netstandard.csproj +++ b/itext/itext.svg/itext.svg.netstandard.csproj @@ -6,7 +6,7 @@ $(TargetDir)bin\$(Configuration)\$(TargetFramework)\itext.svg.xml - netstandard2.0;net40 + net5.0;netstandard2.0;net40 library diff --git a/itext/itext.svg/itext/svg/processors/impl/SvgProcessorContext.cs b/itext/itext.svg/itext/svg/processors/impl/SvgProcessorContext.cs index d37767aaa0..51fa8d79a6 100644 --- a/itext/itext.svg/itext/svg/processors/impl/SvgProcessorContext.cs +++ b/itext/itext.svg/itext/svg/processors/impl/SvgProcessorContext.cs @@ -130,7 +130,7 @@ public virtual SvgCssContext GetCssContext() { /// the encoding /// the alias /// the specific range of characters to be used from the font - public virtual void AddTemporaryFont(FontProgram fontProgram, String encoding, String alias, Range unicodeRange + public virtual void AddTemporaryFont(FontProgram fontProgram, String encoding, String alias, iText.Layout.Font.Range unicodeRange ) { if (tempFonts == null) { tempFonts = new FontSet(); diff --git a/itext/itext.svg/itext/svg/processors/impl/font/SvgFontProcessor.cs b/itext/itext.svg/itext/svg/processors/impl/font/SvgFontProcessor.cs index 4e73c3078e..f9cef45c61 100644 --- a/itext/itext.svg/itext/svg/processors/impl/font/SvgFontProcessor.cs +++ b/itext/itext.svg/itext/svg/processors/impl/font/SvgFontProcessor.cs @@ -87,7 +87,7 @@ public virtual void AddFontFaceFonts(ICssResolver cssResolver) { /// the font family /// the source of the font /// true, if successful - private bool CreateFont(String fontFamily, CssFontFace.CssFontFaceSrc src, Range unicodeRange) { + private bool CreateFont(String fontFamily, CssFontFace.CssFontFaceSrc src, iText.Layout.Font.Range unicodeRange) { if (!CssFontFace.IsSupportedFontFormat(src.GetFormat())) { return false; } diff --git a/itext7.nuspec b/itext7.nuspec index 7317f6c2df..d212168301 100644 --- a/itext7.nuspec +++ b/itext7.nuspec @@ -2,7 +2,7 @@ itext7 - 7.1.15-SNAPSHOT + 7.2.0-SNAPSHOT iText 7 Community iText Software iText Software @@ -37,6 +37,11 @@ + + + + + @@ -76,6 +81,24 @@ + + + + + + + + + + + + + + + + + +