Skip to content

Commit

Permalink
Merge branch 'develop' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Oct 12, 2024
2 parents 3be9d49 + 31c34cb commit 49717d5
Show file tree
Hide file tree
Showing 43 changed files with 294 additions and 145 deletions.
6 changes: 3 additions & 3 deletions itext.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>itext</id>
<version>9.0.0-SNAPSHOT</version>
<version>9.0.1-SNAPSHOT</version>
<title>iText Community</title>
<authors>Apryse Software</authors>
<owners>Apryse Software</owners>
Expand All @@ -19,11 +19,11 @@
<repository type="git" url="https://github.com/itext/itext7-dotnet.git" />
<dependencies>
<group targetFramework="net461">
<dependency id="itext.commons" version="9.0.0-SNAPSHOT" />
<dependency id="itext.commons" version="9.0.1-SNAPSHOT" />
<dependency id="Microsoft.Extensions.Logging" version="5.0.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="itext.commons" version="9.0.0-SNAPSHOT" />
<dependency id="itext.commons" version="9.0.1-SNAPSHOT" />
<dependency id="Microsoft.Extensions.Logging" version="5.0.0" />
<dependency id="System.Diagnostics.Process" version="4.3.0" />
<dependency id="System.Globalization.Extensions" version="4.3.0" />
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

[assembly: Guid("d015a3aa-613c-45d9-b908-7d47c4b613af")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.commons.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("502eda37-c014-4822-8e5c-4e5d21b085e9")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

[assembly: Guid("6fe2f714-6b3e-4b20-8c70-28bfce084ed2")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.io.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("a53a5dd3-787b-4563-8778-1d76bdad57ba")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.kernel.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("02e54061-eb72-409d-b2c0-307ce66b57e9")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,38 @@ You should have received a copy of the GNU Affero General Public License
namespace iText.Kernel.Pdf.Canvas.Parser {
[NUnit.Framework.Category("IntegrationTest")]
public class PdfContentExtractionTest : ExtendedITextTest {
private static readonly String sourceFolder = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
private static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/kernel/parser/PdfContentExtractionTest/";

[NUnit.Framework.Test]
public virtual void ContentExtractionInDocWithBigCoordinatesTest() {
//TODO: remove the expected exception construct once the issue is fixed (DEVSIX-1279)
String inputFileName = sourceFolder + "docWithBigCoordinates.pdf";
//In this document the CTM shrinks coordinates and this coordinates are large numbers.
String inputFileName = SOURCE_FOLDER + "docWithBigCoordinates.pdf";
// In this document the CTM shrinks coordinates and these coordinates are large numbers.
// At the moment creation of this test clipper has a problem with handling large numbers
// since internally it deals with integers and has to multiply large numbers even more
// for internal purposes
PdfDocument pdfDocument = new PdfDocument(new PdfReader(inputFileName));
PdfDocumentContentParser contentParser = new PdfDocumentContentParser(pdfDocument);
Exception e = NUnit.Framework.Assert.Catch(typeof(ClipperException), () => contentParser.ProcessContent(1,
new LocationTextExtractionStrategy()));
NUnit.Framework.Assert.AreEqual(ClipperExceptionConstant.COORDINATE_OUTSIDE_ALLOWED_RANGE, e.Message);
using (PdfDocument pdfDocument = new PdfDocument(new PdfReader(inputFileName))) {
PdfDocumentContentParser contentParser = new PdfDocumentContentParser(pdfDocument);
NUnit.Framework.Assert.DoesNotThrow(() => contentParser.ProcessContent(1, new LocationTextExtractionStrategy
()));
}
}

[NUnit.Framework.Test]
public virtual void ContentExtractionInDocWithStaticFloatMultiplierTest() {
String inputFileName = SOURCE_FOLDER + "docWithBigCoordinates.pdf";
// In this document the CTM shrinks coordinates and these coordinates are large numbers.
// At the moment creation of this test clipper has a problem with handling large numbers
// since internally it deals with integers and has to multiply large numbers even more
// for internal purposes
using (PdfDocument pdfDocument = new PdfDocument(new PdfReader(inputFileName))) {
PdfDocumentContentParser contentParser = new PdfDocumentContentParser(pdfDocument);
ClipperBridge.floatMultiplier = Math.Pow(10, 14);
Exception e = NUnit.Framework.Assert.Catch(typeof(ClipperException), () => contentParser.ProcessContent(1,
new LocationTextExtractionStrategy()));
NUnit.Framework.Assert.AreEqual(ClipperExceptionConstant.COORDINATE_OUTSIDE_ALLOWED_RANGE, e.Message);
ClipperBridge.floatMultiplier = null;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You should have received a copy of the GNU Affero General Public License
*/
using System.Collections.Generic;
using System.Linq;
using iText.Commons.Utils;
using iText.Kernel.Geom;
using iText.Kernel.Pdf.Canvas;
using iText.Test;
Expand All @@ -48,11 +49,12 @@ public virtual void SquareClippingTest() {
Path rectanglePath = new Path();
rectanglePath.AddSubpath(rectangleSubpath);
Clipper clipper = new Clipper();
ClipperBridge.AddPath(clipper, squarePath, PolyType.SUBJECT);
ClipperBridge.AddPath(clipper, rectanglePath, PolyType.CLIP);
ClipperBridge clipperBridge = new ClipperBridge(squarePath, rectanglePath);
clipperBridge.AddPath(clipper, squarePath, PolyType.SUBJECT);
clipperBridge.AddPath(clipper, rectanglePath, PolyType.CLIP);
PolyTree polyTree = new PolyTree();
clipper.Execute(ClipType.UNION, polyTree);
Path result = ClipperBridge.ConvertToPath(polyTree);
Path result = clipperBridge.ConvertToPath(polyTree);
NUnit.Framework.Assert.AreEqual(new Point(20, 40), result.GetCurrentPoint());
NUnit.Framework.Assert.AreEqual(2, result.GetSubpaths().Count);
Subpath closedPath = result.GetSubpaths()[0];
Expand Down Expand Up @@ -95,14 +97,34 @@ public virtual void GetEndTypeTest() {
public virtual void LongRectWidthTest() {
IntRect longRect = new IntRect(14900000000000000L, 21275000000000000L, 71065802001953128L, 71075000000000000L
);
NUnit.Framework.Assert.AreEqual(561.658, ClipperBridge.LongRectCalculateWidth(longRect), 0.001f);
NUnit.Framework.Assert.AreEqual(561.658, new ClipperBridge().LongRectCalculateWidth(longRect), 0.001f);
}

[NUnit.Framework.Test]
public virtual void LongRectHeightTest() {
IntRect longRect = new IntRect(14900000000000000L, 21275000000000000L, 71065802001953128L, 71075000000000000L
);
NUnit.Framework.Assert.AreEqual(498, ClipperBridge.LongRectCalculateHeight(longRect), 0.001f);
NUnit.Framework.Assert.AreEqual(498, new ClipperBridge().LongRectCalculateHeight(longRect), 0.001f);
}

[NUnit.Framework.Test]
public virtual void DynamicFloatMultiplierCalculationsSmallValuesTest() {
Point[] points = new Point[] { new Point(1e-10, 0), new Point(0, 1e-13) };
NUnit.Framework.Assert.AreEqual(1.8014398509481984e26, new ClipperBridge(points).GetFloatMultiplier(), 0e+10
);
}

[NUnit.Framework.Test]
public virtual void DynamicFloatMultiplierCalculationsBigValuesTest() {
Point[] points = new Point[] { new Point(1e+11, 10), new Point(10, 1e+10) };
NUnit.Framework.Assert.AreEqual(180143, new ClipperBridge(points).GetFloatMultiplier(), 0.001f);
}

[NUnit.Framework.Test]
public virtual void SmallFloatMultiplierCoefficientTest() {
Point[] points = new Point[] { new Point(1e-10, 1e+10) };
NUnit.Framework.Assert.AreEqual(new IntPoint(0, 18014390000000000L), new ClipperBridge(points).ConvertToLongPoints
(JavaUtil.ArraysAsList(points))[0]);
}

private bool AreShapesEqual(IShape expected, IShape actual) {
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.layout.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("9ad347a8-ea5b-462b-810c-998f04471bb7")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(600000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.pdfa.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("b7c0e021-71ac-4c97-9a51-8356f1bd53c7")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.pdftest.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

[assembly: Guid("f9880dc4-f015-4413-af86-66d0e9512774")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]
6 changes: 3 additions & 3 deletions itext.tests/itext.pdfua.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("f542854e-7f6b-4207-b6ca-004a5d266e65")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.sign.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("be15bdf3-b184-4e2f-8459-ebee3160e19d")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("409b5131-4d0c-4e4b-9c7b-2407a8356ca4")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.svg.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

[assembly: Guid("ae4e5743-0665-4705-9a33-07ea57cdd269")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext/itext.barcodes/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

[assembly: Guid("8694665a-5749-40c6-9e9c-53c686a77ad1")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]
6 changes: 3 additions & 3 deletions itext/itext.bouncy-castle-adapter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

[assembly: Guid("3c83a192-e64a-4134-ade9-38f65c8e9fca")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>itext.bouncy-castle-adapter</id>
<version>9.0.0-SNAPSHOT</version>
<version>9.0.1-SNAPSHOT</version>
<title>iText bouncy-castle adapter module</title>
<authors>Apryse Software</authors>
<owners>Apryse Software</owners>
Expand All @@ -18,11 +18,11 @@
<tags>itext itext7 itextsharp c# .net csharp</tags>
<dependencies>
<group targetFramework="net461">
<dependency id="itext.commons" version="9.0.0-SNAPSHOT" />
<dependency id="itext.commons" version="9.0.1-SNAPSHOT" />
<dependency id="BouncyCastle.Cryptography" version="2.4.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="itext.commons" version="9.0.0-SNAPSHOT" />
<dependency id="itext.commons" version="9.0.1-SNAPSHOT" />
<dependency id="BouncyCastle.Cryptography" version="2.4.0" />
</group>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

[assembly: Guid("56eaf103-2032-43eb-a7dd-fbeea5c5cb9c")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@

[assembly: Guid("4e9a859e-f268-49cc-ac3c-c5b9632b3290")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>itext.bouncy-castle-fips-adapter</id>
<version>9.0.0-SNAPSHOT</version>
<version>9.0.1-SNAPSHOT</version>
<title>iText bouncy-castle FIPS adapter module</title>
<authors>Apryse Software</authors>
<owners>Apryse Software</owners>
Expand All @@ -18,7 +18,7 @@
<tags>itext itext7 itextsharp c# .net csharp</tags>
<dependencies>
<group targetFramework="netstandard2.0">
<dependency id="itext.commons" version="9.0.0-SNAPSHOT" />
<dependency id="itext.commons" version="9.0.1-SNAPSHOT" />
</group>
</dependencies>
</metadata>
Expand Down
6 changes: 3 additions & 3 deletions itext/itext.commons/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@

[assembly: Guid("339569d2-3ba2-41cc-972c-70b05e4c4fcd")]

[assembly: AssemblyVersion("9.0.0.0")]
[assembly: AssemblyFileVersion("9.0.0.0")]
[assembly: AssemblyInformationalVersion("9.0.0-SNAPSHOT")]
[assembly: AssemblyVersion("9.0.1.0")]
[assembly: AssemblyFileVersion("9.0.1.0")]
[assembly: AssemblyInformationalVersion("9.0.1-SNAPSHOT")]
2 changes: 1 addition & 1 deletion itext/itext.commons/itext-commons.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>itext.commons</id>
<version>9.0.0-SNAPSHOT</version>
<version>9.0.1-SNAPSHOT</version>
<title>iText commons module</title>
<authors>Apryse Software</authors>
<owners>Apryse Software</owners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class CommonsProductData {
//\endcond

//\cond DO_NOT_DOCUMENT
internal const String COMMONS_VERSION = "9.0.0-SNAPSHOT";
internal const String COMMONS_VERSION = "9.0.1-SNAPSHOT";
//\endcond

//\cond DO_NOT_DOCUMENT
Expand Down
Loading

0 comments on commit 49717d5

Please sign in to comment.