Skip to content

Commit 9b86c94

Browse files
committed
[RELEASE] iText 8.0.2
2 parents 6ebc934 + d0e8649 commit 9b86c94

File tree

788 files changed

+18523
-2016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

788 files changed

+18523
-2016
lines changed

doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "iText 8.0.1 API"
35+
PROJECT_NAME = "iText 8.0.2 API"
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version

itext.nuspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata>
44
<id>itext</id>
5-
<version>8.0.1</version>
5+
<version>8.0.2</version>
66
<title>iText Community</title>
77
<authors>Apryse Software</authors>
88
<owners>Apryse Software</owners>
@@ -19,11 +19,11 @@
1919
<repository type="git" url="https://github.com/itext/itext7-dotnet.git" />
2020
<dependencies>
2121
<group targetFramework="net461">
22-
<dependency id="itext.commons" version="8.0.1" />
22+
<dependency id="itext.commons" version="8.0.2" />
2323
<dependency id="Microsoft.Extensions.Logging" version="5.0.0" />
2424
</group>
2525
<group targetFramework="netstandard2.0">
26-
<dependency id="itext.commons" version="8.0.1" />
26+
<dependency id="itext.commons" version="8.0.2" />
2727
<dependency id="Microsoft.Extensions.Logging" version="5.0.0" />
2828
<dependency id="System.Diagnostics.Process" version="4.3.0" />
2929
<dependency id="System.Globalization.Extensions" version="4.3.0" />

itext.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

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

17-
[assembly: AssemblyVersion("8.0.1.0")]
18-
[assembly: AssemblyFileVersion("8.0.1.0")]
19-
[assembly: AssemblyInformationalVersion("8.0.1")]
17+
[assembly: AssemblyVersion("8.0.2.0")]
18+
[assembly: AssemblyFileVersion("8.0.2.0")]
19+
[assembly: AssemblyInformationalVersion("8.0.2")]
2020

2121
#if !NETSTANDARD2_0
2222
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.commons.tests/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

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

18-
[assembly: AssemblyVersion("8.0.1.0")]
19-
[assembly: AssemblyFileVersion("8.0.1.0")]
20-
[assembly: AssemblyInformationalVersion("8.0.1")]
18+
[assembly: AssemblyVersion("8.0.2.0")]
19+
[assembly: AssemblyFileVersion("8.0.2.0")]
20+
[assembly: AssemblyInformationalVersion("8.0.2")]
2121

2222
#if !NETSTANDARD2_0
2323
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.commons.tests/itext/commons/datastructures/BiMapTest.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ You should have received a copy of the GNU Affero General Public License
2121
along with this program. If not, see <https://www.gnu.org/licenses/>.
2222
*/
2323
using System;
24+
using iText.Test;
2425

2526
namespace iText.Commons.Datastructures {
2627
[NUnit.Framework.Category("UnitTest")]
27-
public class BiMapTest {
28+
public class BiMapTest : ExtendedITextTest {
2829
[NUnit.Framework.Test]
2930
public virtual void SizeTest01() {
3031
BiMap<String, int> map = new BiMap<String, int>();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2023 Apryse Group NV
4+
Authors: Apryse Software.
5+
6+
This program is offered under a commercial and under the AGPL license.
7+
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
8+
9+
AGPL licensing:
10+
This program is free software: you can redistribute it and/or modify
11+
it under the terms of the GNU Affero General Public License as published by
12+
the Free Software Foundation, either version 3 of the License, or
13+
(at your option) any later version.
14+
15+
This program is distributed in the hope that it will be useful,
16+
but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
GNU Affero General Public License for more details.
19+
20+
You should have received a copy of the GNU Affero General Public License
21+
along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
*/
23+
using System;
24+
using iText.Test;
25+
26+
namespace iText.Commons.Utils {
27+
[NUnit.Framework.Category("UnitTest")]
28+
public class DIContainerTest : ExtendedITextTest {
29+
[NUnit.Framework.Test]
30+
public virtual void TestGetRegisteredInstance() {
31+
DIContainer di = new DIContainer();
32+
di.Register(typeof(String), "hello");
33+
NUnit.Framework.Assert.AreEqual("hello", di.GetInstance<String>());
34+
}
35+
36+
[NUnit.Framework.Test]
37+
public virtual void TestRegisterDefaultInstance() {
38+
DIContainer.RegisterDefault(typeof(String), () => "hello");
39+
DIContainer di = new DIContainer();
40+
NUnit.Framework.Assert.AreEqual("hello", di.GetInstance<String>());
41+
}
42+
}
43+
}

itext.tests/itext.commons.tests/itext/commons/utils/DateTimeUtilTest.cs

+9
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ public void ParseDateAndGetUtcMillisFromEpochTest()
5353
Assert.AreEqual(1588636800000d - offset, millisFromEpochTo2020_05_05, ZERO_DELTA);
5454
}
5555

56+
[Test]
57+
public void AddMillisToDateTest() {
58+
DateTime almostCurrentTime = DateTime.Now.AddMilliseconds(-2000);
59+
long twoSeconds = 2000;
60+
Assert.AreEqual(DateTimeUtil.GetRelativeTime(DateTime.Now),
61+
DateTimeUtil.GetRelativeTime(DateTimeUtil.AddMillisToDate(almostCurrentTime, twoSeconds)),
62+
ONE_SECOND_DELTA);
63+
}
64+
5665
[Test]
5766
public void CompareUtcMillisFromEpochWithNullParamAndCurrentTimeTest() {
5867
double getUtcMillisFromEpochWithNullParam = DateTimeUtil.GetUtcMillisFromEpoch(null);

itext.tests/itext.forms.tests/Properties/AssemblyInfo.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

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

17-
[assembly: AssemblyVersion("8.0.1.0")]
18-
[assembly: AssemblyFileVersion("8.0.1.0")]
19-
[assembly: AssemblyInformationalVersion("8.0.1")]
17+
[assembly: AssemblyVersion("8.0.2.0")]
18+
[assembly: AssemblyFileVersion("8.0.2.0")]
19+
[assembly: AssemblyInformationalVersion("8.0.2")]
2020

2121
#if !NETSTANDARD2_0
2222
[assembly: NUnit.Framework.Timeout(300000)]

itext.tests/itext.forms.tests/itext/forms/FlatteningTest.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ public virtual void FormFlatteningTestWithoutNEntry() {
6262
String dest = destinationFolder + filename + "_flattened.pdf";
6363
String cmp = sourceFolder + "cmp_" + filename + "_flattened.pdf";
6464
PdfDocument doc = new PdfDocument(new PdfReader(src), new PdfWriter(dest));
65-
PdfFormCreator.GetAcroForm(doc, false).FlattenFields();
65+
PdfAcroForm acroForm = PdfFormCreator.GetAcroForm(doc, false);
66+
acroForm.SetGenerateAppearance(false);
67+
acroForm.FlattenFields();
6668
doc.Close();
6769
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
6870
}

itext.tests/itext.forms.tests/itext/forms/PdfFormFieldTest.cs

+43-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ You should have received a copy of the GNU Affero General Public License
3434
using iText.Kernel.Pdf;
3535
using iText.Kernel.Pdf.Annot;
3636
using iText.Kernel.Pdf.Canvas;
37+
using iText.Kernel.Pdf.Xobject;
3738
using iText.Kernel.Utils;
3839
using iText.Layout;
3940
using iText.Layout.Element;
@@ -517,7 +518,6 @@ public virtual void AcroFieldDictionaryNoFields() {
517518
}
518519

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

1528+
[NUnit.Framework.Test]
1529+
public virtual void SignatureLayersTest() {
1530+
String fileName = destinationFolder + "signatureLayersTest.pdf";
1531+
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(fileName));
1532+
PdfAcroForm form = PdfFormCreator.GetAcroForm(pdfDoc, true);
1533+
pdfDoc.AddNewPage();
1534+
PdfSignatureFormField signField = new SignatureFormFieldBuilder(pdfDoc, "signature").SetWidgetRectangle(new
1535+
Rectangle(36, 436, 100, 100)).CreateSignature();
1536+
PdfFormXObject layer0 = new PdfFormXObject(new Rectangle(0, 0, 100, 100));
1537+
// Draw pink rectangle with blue border
1538+
new PdfCanvas(layer0, pdfDoc).SaveState().SetFillColor(ColorConstants.PINK).SetStrokeColor(ColorConstants.
1539+
BLUE).Rectangle(0, 0, 100, 100).FillStroke().RestoreState();
1540+
PdfFormXObject layer2 = new PdfFormXObject(new Rectangle(0, 0, 100, 100));
1541+
// Draw yellow circle with gray border
1542+
new PdfCanvas(layer2, pdfDoc).SaveState().SetFillColor(ColorConstants.YELLOW).SetStrokeColor(ColorConstants
1543+
.DARK_GRAY).Circle(50, 50, 50).FillStroke().RestoreState();
1544+
signField.SetBackgroundLayer(layer0).SetSignatureAppearanceLayer(layer2);
1545+
form.AddField(signField);
1546+
pdfDoc.Close();
1547+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(fileName, sourceFolder + "cmp_signatureLayersTest.pdf"
1548+
, destinationFolder, "diff_"));
1549+
}
1550+
1551+
[NUnit.Framework.Test]
1552+
public virtual void PdfWithSignatureFieldTest() {
1553+
String fileName = destinationFolder + "pdfWithSignatureFieldTest.pdf";
1554+
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(fileName));
1555+
PdfAcroForm form = PdfFormCreator.GetAcroForm(pdfDoc, true);
1556+
pdfDoc.AddNewPage();
1557+
PdfFormField signField = new SignatureFormFieldBuilder(pdfDoc, "signature").SetWidgetRectangle(new Rectangle
1558+
(100, 600, 400, 150)).CreateSignature();
1559+
signField.GetPdfObject().Put(PdfName.Name, new PdfName("test name"));
1560+
signField.GetPdfObject().Put(PdfName.Reason, new PdfString("test reason"));
1561+
signField.GetPdfObject().Put(PdfName.Location, new PdfString("test location"));
1562+
signField.GetPdfObject().Put(PdfName.ContactInfo, new PdfString("test contact"));
1563+
signField.GetFirstFormAnnotation().SetBackgroundColor(ColorConstants.PINK).SetColor(ColorConstants.WHITE);
1564+
form.AddField(signField);
1565+
pdfDoc.Close();
1566+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(fileName, sourceFolder + "cmp_pdfWithSignatureFieldTest.pdf"
1567+
, destinationFolder, "diff_"));
1568+
}
1569+
15281570
internal class CustomButtonFormField : PdfButtonFormField {
15291571
private int counter = 0;
15301572

itext.tests/itext.forms.tests/itext/forms/XfdfWriterTest.cs

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public virtual void SimpleFormWithOneFieldTest() {
5959
}
6060

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

0 commit comments

Comments
 (0)