Skip to content

Commit 96657ab

Browse files
committed
[RELEASE] iText 7 Core - 7.1.16
https://github.com/itext/itext7-dotnet/releases/tag/7.1.16 * release_branch_DEVSIX-5154: [RELEASE] 7.1.16 Make EventData building based on IEvent synchronization independent from factory instance Perform scheduled check based on latest acquired Version instance Remove TODO related to already closed DEVSIX-5049 Add support of attr() with type for url and string Add support of attr() with fallback for url and string Add support of attr() in target-counter Add tests Add missing copyright headers SVG: Add possibility to customize renderers for text chunks Prepare TargetCounterHandler to used from pure layout code Fix margin-border-padding widths for floating Text min-max-width calculation Rename #createDocument to #createDummyDocument in RendererUnitTest Fix some confusing Javadoc about OCSP Add DEVSIX reference to TODOs in tagging utilities for proper tags removal Improve StructTreeRoot documentation Improve GhostScript and ImageMagick util classes formatting and their tests Relax fuzziness parameter for ImageMagickHelper test Simplify ghostscript util test for -dSAFER command Replace ExpectedException.none to Assert.assertThrows Update autoported files Add support processing inline image with ICCBased color space in resources Add missing copyright headers Improve code coverage Add missing copyright headers Refactor preClose method in PdfSigner Add integration test for handling signatures with not merged widgets Add missing copyright headers Replace html2pdf-private tests: CssStyleAttributeParseTest Improve javadocs of TextRenderer Fix constructor of PdfReader to close() the PdfTokenizer when exception thrown Add PdfWriter/PdfReader/PdfDocument constructors to try-with-resources Add tests to compareLinkAnnotation method and encrypt method Improve javadocs for new code in Type3Font handling Set typo ascender/descender for type3 fonts based on font dictionary Add JavaUtil.Fill method overloads for different primitive types Remove TODOs from PdfTrueTypeFont class Cover AnnotationDefaultAppearance and PdfAction with documentation Cover Pdf3DAnnotation with javadocs Add missing copyright headers Support encrypting embedded files only Add overridden method without message for AssertThrows Improve the security of XML parsers Remove DTDs with non-existent reference from patterns in hyph module Add AssertUtil.cs with anolog of java's assertThrows method Add some tests on TextRenderer extensions. Add appropriate documentation. Log a message in case getNextRenderer is not overridden in an extended class. Improve its javadoc Improve FontSelector with comparing font weights Fix rounded border logic in layout Introduce lazy initialization for some of pdfDocument fields Remove redundant todo from deprecated method Add ImageTypeDetector's stream overload Implement unicode encoding for producer line in PDF Remove redundant mentions of SvgRegexUtils class Introduce support of intrinsic aspect ratio in flex algorithm Update port-hash after release [AFTER RELEASE] 7.1.15 Remove Maven plugins: CheckStyle, PMD, SpotBugs Add tests on cells with big rowspan issues Add functionality to compare pdf signatures in tests Improve CssTypesValidation documentation Add tests to increase CrlClientOnline code coverage Get rid of new javadoc warnings Update port-hash Upgrade verapdf-validation-model to 1.18.2
2 parents 8464949 + bec3294 commit 96657ab

File tree

622 files changed

+9687
-5419
lines changed

Some content is hidden

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

622 files changed

+9687
-5419
lines changed

doxyfile

Lines changed: 1 addition & 1 deletion
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 7 7.1.15 API"
35+
PROJECT_NAME = "iText 7 7.1.16 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.tests/itext.barcodes.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
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("7.1.15.0")]
18-
[assembly: AssemblyFileVersion("7.1.15.0")]
19-
[assembly: AssemblyInformationalVersion("7.1.15")]
17+
[assembly: AssemblyVersion("7.1.16.0")]
18+
[assembly: AssemblyFileVersion("7.1.16.0")]
19+
[assembly: AssemblyInformationalVersion("7.1.16")]
2020

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

itext.tests/itext.barcodes.tests/itext/barcodes/BarcodeDataMatrixTest.cs

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -208,41 +208,32 @@ public virtual void Barcode11Test() {
208208

209209
[NUnit.Framework.Test]
210210
public virtual void Barcode12Test() {
211-
NUnit.Framework.Assert.That(() => {
212-
BarcodeDataMatrix barcodeDataMatrix = new BarcodeDataMatrix();
213-
barcodeDataMatrix.SetWidth(18);
214-
barcodeDataMatrix.SetHeight(18);
215-
byte[] str = "AbcdFFghijklmnop".GetBytes();
216-
barcodeDataMatrix.SetCode(str, -1, str.Length);
217-
}
218-
, NUnit.Framework.Throws.InstanceOf<IndexOutOfRangeException>())
219-
;
211+
BarcodeDataMatrix barcodeDataMatrix = new BarcodeDataMatrix();
212+
barcodeDataMatrix.SetWidth(18);
213+
barcodeDataMatrix.SetHeight(18);
214+
byte[] str = "AbcdFFghijklmnop".GetBytes();
215+
Exception e = NUnit.Framework.Assert.Catch(typeof(IndexOutOfRangeException), () => barcodeDataMatrix.SetCode
216+
(str, -1, str.Length));
220217
}
221218

222219
[NUnit.Framework.Test]
223220
public virtual void Barcode13Test() {
224-
NUnit.Framework.Assert.That(() => {
225-
BarcodeDataMatrix barcodeDataMatrix = new BarcodeDataMatrix();
226-
barcodeDataMatrix.SetWidth(18);
227-
barcodeDataMatrix.SetHeight(18);
228-
byte[] str = "AbcdFFghijklmnop".GetBytes();
229-
barcodeDataMatrix.SetCode(str, 0, str.Length + 1);
230-
}
231-
, NUnit.Framework.Throws.InstanceOf<IndexOutOfRangeException>())
232-
;
221+
BarcodeDataMatrix barcodeDataMatrix = new BarcodeDataMatrix();
222+
barcodeDataMatrix.SetWidth(18);
223+
barcodeDataMatrix.SetHeight(18);
224+
byte[] str = "AbcdFFghijklmnop".GetBytes();
225+
NUnit.Framework.Assert.Catch(typeof(IndexOutOfRangeException), () => barcodeDataMatrix.SetCode(str, 0, str
226+
.Length + 1));
233227
}
234228

235229
[NUnit.Framework.Test]
236230
public virtual void Barcode14Test() {
237-
NUnit.Framework.Assert.That(() => {
238-
BarcodeDataMatrix barcodeDataMatrix = new BarcodeDataMatrix();
239-
barcodeDataMatrix.SetWidth(18);
240-
barcodeDataMatrix.SetHeight(18);
241-
byte[] str = "AbcdFFghijklmnop".GetBytes();
242-
barcodeDataMatrix.SetCode(str, 0, -1);
243-
}
244-
, NUnit.Framework.Throws.InstanceOf<IndexOutOfRangeException>())
245-
;
231+
BarcodeDataMatrix barcodeDataMatrix = new BarcodeDataMatrix();
232+
barcodeDataMatrix.SetWidth(18);
233+
barcodeDataMatrix.SetHeight(18);
234+
byte[] str = "AbcdFFghijklmnop".GetBytes();
235+
NUnit.Framework.Assert.Catch(typeof(IndexOutOfRangeException), () => barcodeDataMatrix.SetCode(str, 0, -1)
236+
);
246237
}
247238

248239
[NUnit.Framework.Test]

itext.tests/itext.barcodes.tests/itext/barcodes/BarcodeEANUnitTest.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,14 @@ public virtual void GetBarcodeSizeSUPP2Test() {
187187

188188
[NUnit.Framework.Test]
189189
public virtual void GetBarcodeSizeIncorrectTypeTest() {
190-
NUnit.Framework.Assert.That(() => {
191-
PdfDocument document = new PdfDocument(new PdfWriter(new MemoryStream()));
192-
Barcode1D barcode = new BarcodeEAN(document);
193-
barcode.SetCode("9781935182610");
194-
// Set incorrect type
195-
barcode.SetCodeType(1234);
196-
// We do expect an exception here
197-
barcode.GetBarcodeSize();
198-
}
199-
, NUnit.Framework.Throws.InstanceOf<PdfException>().With.Message.EqualTo("Invalid code type"))
200-
;
190+
PdfDocument document = new PdfDocument(new PdfWriter(new MemoryStream()));
191+
Barcode1D barcode = new BarcodeEAN(document);
192+
barcode.SetCode("9781935182610");
193+
// Set incorrect type
194+
barcode.SetCodeType(1234);
195+
// We do expect an exception here
196+
Exception e = NUnit.Framework.Assert.Catch(typeof(PdfException), () => barcode.GetBarcodeSize());
197+
NUnit.Framework.Assert.AreEqual("Invalid code type", e.Message);
201198
}
202199
}
203200
}

itext.tests/itext.barcodes.tests/itext/barcodes/BarcodePDF417Test.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -315,19 +315,16 @@ public virtual void Barcode417OptionsWithBarcodeGenerationTest() {
315315

316316
[NUnit.Framework.Test]
317317
public virtual void Barcode417OptionsWithBarcodeGenerationInvalidSizeTest() {
318-
NUnit.Framework.Assert.That(() => {
319-
MemoryStream baos = new MemoryStream();
320-
PdfWriter writer = new PdfWriter(baos);
321-
PdfDocument document = new PdfDocument(writer);
322-
PdfPage page = document.AddNewPage();
323-
PdfCanvas canvas = new PdfCanvas(page);
324-
BarcodePDF417 barcode = new BarcodePDF417();
325-
barcode.SetOptions(64);
326-
barcode.PlaceBarcode(canvas, null);
327-
NUnit.Framework.Assert.AreEqual(64, barcode.GetOptions());
328-
}
329-
, NUnit.Framework.Throws.InstanceOf<PdfException>().With.Message.EqualTo("Invalid codeword size."))
330-
;
318+
MemoryStream baos = new MemoryStream();
319+
PdfWriter writer = new PdfWriter(baos);
320+
PdfDocument document = new PdfDocument(writer);
321+
PdfPage page = document.AddNewPage();
322+
PdfCanvas canvas = new PdfCanvas(page);
323+
BarcodePDF417 barcode = new BarcodePDF417();
324+
barcode.SetOptions(64);
325+
Exception e = NUnit.Framework.Assert.Catch(typeof(PdfException), () => barcode.PlaceBarcode(canvas, null));
326+
NUnit.Framework.Assert.AreEqual("Invalid codeword size.", e.Message);
327+
NUnit.Framework.Assert.AreEqual(64, barcode.GetOptions());
331328
}
332329

333330
private PdfFormXObject CreateMacroBarcodePart(PdfDocument document, String text, float mh, float mw, int segmentId

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

Lines changed: 3 additions & 3 deletions
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("7.1.15.0")]
18-
[assembly: AssemblyFileVersion("7.1.15.0")]
19-
[assembly: AssemblyInformationalVersion("7.1.15")]
17+
[assembly: AssemblyVersion("7.1.16.0")]
18+
[assembly: AssemblyFileVersion("7.1.16.0")]
19+
[assembly: AssemblyInformationalVersion("7.1.16")]
2020

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

itext.tests/itext.forms.tests/itext/forms/XfdfUnitTest.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,16 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2020
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
*/
23+
using System;
2324
using iText.Forms.Xfdf;
2425
using iText.Test;
2526

2627
namespace iText.Forms {
2728
public class XfdfUnitTest : ExtendedITextTest {
2829
[NUnit.Framework.Test]
2930
public virtual void FitObjectWithEmptyPageTest() {
30-
NUnit.Framework.Assert.That(() => {
31-
FitObject fitObject = new FitObject(null);
32-
NUnit.Framework.Assert.Fail();
33-
}
34-
, NUnit.Framework.Throws.InstanceOf<XfdfException>().With.Message.EqualTo(XfdfException.PAGE_IS_MISSING))
35-
;
31+
Exception e = NUnit.Framework.Assert.Catch(typeof(XfdfException), () => new FitObject(null));
32+
NUnit.Framework.Assert.AreEqual(XfdfException.PAGE_IS_MISSING, e.Message);
3633
}
3734
}
3835
}

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -955,21 +955,21 @@ public virtual void XfdfDropDown() {
955955

956956
[NUnit.Framework.Test]
957957
public virtual void XfdfEmptyAttributeTest() {
958-
NUnit.Framework.Assert.That(() => {
959-
XfdfObject xfdfObject = new XfdfObject();
960-
AnnotsObject annots = new AnnotsObject();
961-
xfdfObject.SetAnnots(annots);
962-
AnnotObject annot = new AnnotObject();
963-
annots.AddAnnot(annot);
964-
String namePresent = "name1";
965-
String nameAbsent = null;
966-
String valuePresent = "value";
967-
String valueAbsent = null;
968-
annot.AddAttribute(new AttributeObject(nameAbsent, valuePresent));
969-
annot.AddAttribute(new AttributeObject(namePresent, valueAbsent));
970-
}
971-
, NUnit.Framework.Throws.InstanceOf<XfdfException>().With.Message.EqualTo(XfdfException.ATTRIBUTE_NAME_OR_VALUE_MISSING))
972-
;
958+
XfdfObject xfdfObject = new XfdfObject();
959+
AnnotsObject annots = new AnnotsObject();
960+
xfdfObject.SetAnnots(annots);
961+
AnnotObject annot = new AnnotObject();
962+
annots.AddAnnot(annot);
963+
String namePresent = "name1";
964+
String nameAbsent = null;
965+
String valuePresent = "value";
966+
String valueAbsent = null;
967+
Exception e = NUnit.Framework.Assert.Catch(typeof(XfdfException), () => annot.AddAttribute(new AttributeObject
968+
(nameAbsent, valuePresent)));
969+
NUnit.Framework.Assert.AreEqual(XfdfException.ATTRIBUTE_NAME_OR_VALUE_MISSING, e.Message);
970+
Exception e2 = NUnit.Framework.Assert.Catch(typeof(XfdfException), () => annot.AddAttribute(new AttributeObject
971+
(namePresent, valueAbsent)));
972+
NUnit.Framework.Assert.AreEqual(XfdfException.ATTRIBUTE_NAME_OR_VALUE_MISSING, e2.Message);
973973
}
974974
}
975975
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
This file is part of the iText (R) project.
3+
Copyright (c) 1998-2021 iText Group NV
4+
Authors: iText Software.
5+
6+
This program is free software; you can redistribute it and/or modify
7+
it under the terms of the GNU Affero General Public License version 3
8+
as published by the Free Software Foundation with the addition of the
9+
following permission added to Section 15 as permitted in Section 7(a):
10+
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
11+
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
12+
OF THIRD PARTY RIGHTS
13+
14+
This program is distributed in the hope that it will be useful, but
15+
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16+
or FITNESS FOR A PARTICULAR PURPOSE.
17+
See the GNU Affero General Public License for more details.
18+
You should have received a copy of the GNU Affero General Public License
19+
along with this program; if not, see http://www.gnu.org/licenses or write to
20+
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21+
Boston, MA, 02110-1301 USA, or download the license from the following URL:
22+
http://itextpdf.com/terms-of-use/
23+
24+
The interactive user interfaces in modified source and object code versions
25+
of this program must display Appropriate Legal Notices, as required under
26+
Section 5 of the GNU Affero General Public License.
27+
28+
In accordance with Section 7(b) of the GNU Affero General Public License,
29+
a covered work must retain the producer line in every PDF that is created
30+
or manipulated using iText.
31+
32+
You can be released from the requirements of the license by purchasing
33+
a commercial license. Buying such a license is mandatory as soon as you
34+
develop commercial activities involving the iText software without
35+
disclosing the source code of your own applications.
36+
These activities include: offering paid services to customers as an ASP,
37+
serving PDFs on the fly in a web application, shipping iText with a closed
38+
source product.
39+
40+
For more information, please contact iText Software Corp. at this
41+
42+
*/
43+
44+
using System;
45+
using System.IO;
46+
using System.Xml;
47+
using iText.Kernel;
48+
using iText.Kernel.Utils;
49+
50+
namespace iText.Forms.Xfa
51+
{
52+
public class SecurityTestXmlParserFactory : IXmlParserFactory
53+
{
54+
private XmlReaderSettings xmlReaderSettings;
55+
56+
public SecurityTestXmlParserFactory()
57+
{
58+
xmlReaderSettings = new XmlReaderSettings();
59+
xmlReaderSettings.DtdProcessing = DtdProcessing.Parse;
60+
xmlReaderSettings.XmlResolver = new TestXmlResolver();
61+
}
62+
63+
public XmlReader CreateXmlReaderInstance(Stream stream, XmlParserContext inputContext)
64+
{
65+
return XmlReader.Create(stream, xmlReaderSettings);
66+
}
67+
68+
public XmlReader CreateXmlReaderInstance(TextReader textReader)
69+
{
70+
return XmlReader.Create(textReader, xmlReaderSettings);
71+
}
72+
73+
private class TestXmlResolver : XmlResolver
74+
{
75+
public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
76+
{
77+
throw new PdfException("Test message");
78+
}
79+
}
80+
}
81+
}

0 commit comments

Comments
 (0)