Skip to content

Commit

Permalink
[RELEASE] iText 8.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Oct 17, 2023
2 parents 6ebc934 + d0e8649 commit 9b86c94
Show file tree
Hide file tree
Showing 788 changed files with 18,523 additions and 2,016 deletions.
2 changes: 1 addition & 1 deletion doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "iText 8.0.1 API"
PROJECT_NAME = "iText 8.0.2 API"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
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>8.0.1</version>
<version>8.0.2</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="8.0.1" />
<dependency id="itext.commons" version="8.0.2" />
<dependency id="Microsoft.Extensions.Logging" version="5.0.0" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="itext.commons" version="8.0.1" />
<dependency id="itext.commons" version="8.0.2" />
<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("8.0.1.0")]
[assembly: AssemblyFileVersion("8.0.1.0")]
[assembly: AssemblyInformationalVersion("8.0.1")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyInformationalVersion("8.0.2")]

#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("8.0.1.0")]
[assembly: AssemblyFileVersion("8.0.1.0")]
[assembly: AssemblyInformationalVersion("8.0.1")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyInformationalVersion("8.0.2")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Test;

namespace iText.Commons.Datastructures {
[NUnit.Framework.Category("UnitTest")]
public class BiMapTest {
public class BiMapTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void SizeTest01() {
BiMap<String, int> map = new BiMap<String, int>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Test;

namespace iText.Commons.Utils {
[NUnit.Framework.Category("UnitTest")]
public class DIContainerTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void TestGetRegisteredInstance() {
DIContainer di = new DIContainer();
di.Register(typeof(String), "hello");
NUnit.Framework.Assert.AreEqual("hello", di.GetInstance<String>());
}

[NUnit.Framework.Test]
public virtual void TestRegisterDefaultInstance() {
DIContainer.RegisterDefault(typeof(String), () => "hello");
DIContainer di = new DIContainer();
NUnit.Framework.Assert.AreEqual("hello", di.GetInstance<String>());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public void ParseDateAndGetUtcMillisFromEpochTest()
Assert.AreEqual(1588636800000d - offset, millisFromEpochTo2020_05_05, ZERO_DELTA);
}

[Test]
public void AddMillisToDateTest() {
DateTime almostCurrentTime = DateTime.Now.AddMilliseconds(-2000);
long twoSeconds = 2000;
Assert.AreEqual(DateTimeUtil.GetRelativeTime(DateTime.Now),
DateTimeUtil.GetRelativeTime(DateTimeUtil.AddMillisToDate(almostCurrentTime, twoSeconds)),
ONE_SECOND_DELTA);
}

[Test]
public void CompareUtcMillisFromEpochWithNullParamAndCurrentTimeTest() {
double getUtcMillisFromEpochWithNullParam = DateTimeUtil.GetUtcMillisFromEpoch(null);
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("8.0.1.0")]
[assembly: AssemblyFileVersion("8.0.1.0")]
[assembly: AssemblyInformationalVersion("8.0.1")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyInformationalVersion("8.0.2")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
4 changes: 3 additions & 1 deletion itext.tests/itext.forms.tests/itext/forms/FlatteningTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public virtual void FormFlatteningTestWithoutNEntry() {
String dest = destinationFolder + filename + "_flattened.pdf";
String cmp = sourceFolder + "cmp_" + filename + "_flattened.pdf";
PdfDocument doc = new PdfDocument(new PdfReader(src), new PdfWriter(dest));
PdfFormCreator.GetAcroForm(doc, false).FlattenFields();
PdfAcroForm acroForm = PdfFormCreator.GetAcroForm(doc, false);
acroForm.SetGenerateAppearance(false);
acroForm.FlattenFields();
doc.Close();
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
}
Expand Down
44 changes: 43 additions & 1 deletion itext.tests/itext.forms.tests/itext/forms/PdfFormFieldTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ You should have received a copy of the GNU Affero General Public License
using iText.Kernel.Pdf;
using iText.Kernel.Pdf.Annot;
using iText.Kernel.Pdf.Canvas;
using iText.Kernel.Pdf.Xobject;
using iText.Kernel.Utils;
using iText.Layout;
using iText.Layout.Element;
Expand Down Expand Up @@ -517,7 +518,6 @@ public virtual void AcroFieldDictionaryNoFields() {
}

[NUnit.Framework.Test]
[NUnit.Framework.Ignore("DEVSIX-7264: Investigate 3 failed forms tests from 7.3/develop on .NET")]
public virtual void RegenerateAppearance() {
String input = "regenerateAppearance.pdf";
String output = "regenerateAppearance.pdf";
Expand Down Expand Up @@ -1525,6 +1525,48 @@ public virtual void DisableChildRegenerationTest() {
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
}

[NUnit.Framework.Test]
public virtual void SignatureLayersTest() {
String fileName = destinationFolder + "signatureLayersTest.pdf";
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(fileName));
PdfAcroForm form = PdfFormCreator.GetAcroForm(pdfDoc, true);
pdfDoc.AddNewPage();
PdfSignatureFormField signField = new SignatureFormFieldBuilder(pdfDoc, "signature").SetWidgetRectangle(new
Rectangle(36, 436, 100, 100)).CreateSignature();
PdfFormXObject layer0 = new PdfFormXObject(new Rectangle(0, 0, 100, 100));
// Draw pink rectangle with blue border
new PdfCanvas(layer0, pdfDoc).SaveState().SetFillColor(ColorConstants.PINK).SetStrokeColor(ColorConstants.
BLUE).Rectangle(0, 0, 100, 100).FillStroke().RestoreState();
PdfFormXObject layer2 = new PdfFormXObject(new Rectangle(0, 0, 100, 100));
// Draw yellow circle with gray border
new PdfCanvas(layer2, pdfDoc).SaveState().SetFillColor(ColorConstants.YELLOW).SetStrokeColor(ColorConstants
.DARK_GRAY).Circle(50, 50, 50).FillStroke().RestoreState();
signField.SetBackgroundLayer(layer0).SetSignatureAppearanceLayer(layer2);
form.AddField(signField);
pdfDoc.Close();
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(fileName, sourceFolder + "cmp_signatureLayersTest.pdf"
, destinationFolder, "diff_"));
}

[NUnit.Framework.Test]
public virtual void PdfWithSignatureFieldTest() {
String fileName = destinationFolder + "pdfWithSignatureFieldTest.pdf";
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(fileName));
PdfAcroForm form = PdfFormCreator.GetAcroForm(pdfDoc, true);
pdfDoc.AddNewPage();
PdfFormField signField = new SignatureFormFieldBuilder(pdfDoc, "signature").SetWidgetRectangle(new Rectangle
(100, 600, 400, 150)).CreateSignature();
signField.GetPdfObject().Put(PdfName.Name, new PdfName("test name"));
signField.GetPdfObject().Put(PdfName.Reason, new PdfString("test reason"));
signField.GetPdfObject().Put(PdfName.Location, new PdfString("test location"));
signField.GetPdfObject().Put(PdfName.ContactInfo, new PdfString("test contact"));
signField.GetFirstFormAnnotation().SetBackgroundColor(ColorConstants.PINK).SetColor(ColorConstants.WHITE);
form.AddField(signField);
pdfDoc.Close();
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(fileName, sourceFolder + "cmp_pdfWithSignatureFieldTest.pdf"
, destinationFolder, "diff_"));
}

internal class CustomButtonFormField : PdfButtonFormField {
private int counter = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public virtual void SimpleFormWithOneFieldTest() {
}

[NUnit.Framework.Test]
[NUnit.Framework.Ignore("DEVSIX-7264: Investigate 3 failed forms tests from 7.3/develop on .NET")]
public virtual void SimpleFormWithMultipleFieldsTest() {
String pdfDocumentName = "simpleFormWithMultipleFields.pdf";
PdfDocument pdfDoc = new PdfDocument(new PdfReader(new FileStream(sourceFolder + pdfDocumentName, FileMode.Open
Expand Down
Loading

0 comments on commit 9b86c94

Please sign in to comment.