Skip to content

Commit a83e371

Browse files
committed
[RELEASE] Merge branch 'release/7.1.2'
2 parents 7759842 + 5c9a20f commit a83e371

File tree

502 files changed

+15657
-1997
lines changed

Some content is hidden

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

502 files changed

+15657
-1997
lines changed

iTextCore.netstandard.with.svg.sln

Lines changed: 314 additions & 0 deletions
Large diffs are not rendered by default.

iTextCore.with.svg.sln

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.barcodes", "itext\itext.barcodes\itext.barcodes.csproj", "{DCAE8241-E391-418D-BA36-C7C064D7C413}"
5+
EndProject
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.font-asian", "itext\itext.font-asian\itext.font-asian.csproj", "{0F10190C-7611-4378-A157-03BF2ED78E30}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.forms", "itext\itext.forms\itext.forms.csproj", "{E2828AC4-3C63-4B2A-B5AD-5F98862775BE}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.hyph", "itext\itext.hyph\itext.hyph.csproj", "{56137079-541A-425A-AB97-43AF63793C97}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.io", "itext\itext.io\itext.io.csproj", "{CEE5E7E1-1BF0-4BE1-9941-903262CE2F83}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.kernel", "itext\itext.kernel\itext.kernel.csproj", "{4E7819E8-7555-4E2E-9A01-D8718A2CFDDA}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.layout", "itext\itext.layout\itext.layout.csproj", "{42173642-DB52-44D3-9883-3E34C65C53BC}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.pdfa", "itext\itext.pdfa\itext.pdfa.csproj", "{9FC2F0B3-A8D2-46DA-8724-72E00E67A8FA}"
19+
EndProject
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.pdftest", "itext\itext.pdftest\itext.pdftest.csproj", "{F9880DC4-F015-4413-AF86-66D0E9512774}"
21+
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.sign", "itext\itext.sign\itext.sign.csproj", "{14A163C0-0054-480D-A096-EDA51DD933EA}"
23+
EndProject
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.barcodes.tests", "itext.tests\itext.barcodes.tests\itext.barcodes.tests.csproj", "{D015A3AA-613C-45D9-B908-7D47C4B613AF}"
25+
EndProject
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.forms.tests", "itext.tests\itext.forms.tests\itext.forms.tests.csproj", "{6FE2F714-6B3E-4B20-8C70-28BFCE084ED2}"
27+
EndProject
28+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.io.tests", "itext.tests\itext.io.tests\itext.io.tests.csproj", "{52A93D37-60D7-4607-8BB2-724D9C46671B}"
29+
EndProject
30+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.kernel.tests", "itext.tests\itext.kernel.tests\itext.kernel.tests.csproj", "{02E54061-EB72-409D-B2C0-307CE66B57E9}"
31+
EndProject
32+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.layout.tests", "itext.tests\itext.layout.tests\itext.layout.tests.csproj", "{9AD347A8-EA5B-462B-810C-998F04471BB7}"
33+
EndProject
34+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.pdfa.tests", "itext.tests\itext.pdfa.tests\itext.pdfa.tests.csproj", "{B7C0E021-71AC-4C97-9A51-8356F1BD53C7}"
35+
EndProject
36+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.sign.tests", "itext.tests\itext.sign.tests\itext.sign.tests.csproj", "{BE15BDF3-B184-4E2F-8459-EBEE3160E19D}"
37+
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.svg", "..\svg\itext\itext.svg\itext.svg.csproj", "{DDEC35D2-5781-471D-5EA1-A6E433EDDB11}"
39+
EndProject
40+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.svg.tests", "..\svg\itext.tests\itext.svg.tests\itext.svg.tests.csproj", "{EA3251AA-1452-3815-1A43-0041AEDEA112}"
41+
EndProject
42+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.styledxmlparser", "..\styled-xml-parser\itext\itext.styledxmlparser\itext.styledxmlparser.csproj", "{8636F290-00DF-403E-B841-E4BFD6D9CE7A}"
43+
EndProject
44+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "itext.styledxmlparser.tests", "..\styled-xml-parser\itext.tests\itext.styledxmlparser.tests\itext.styledxmlparser.tests.csproj", "{ED35E7A1-5725-3258-3A99-AB356EDD5844}"
45+
EndProject
46+
Global
47+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
48+
Debug|Any CPU = Debug|Any CPU
49+
Release|Any CPU = Release|Any CPU
50+
EndGlobalSection
51+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
52+
{DCAE8241-E391-418D-BA36-C7C064D7C413}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
53+
{DCAE8241-E391-418D-BA36-C7C064D7C413}.Debug|Any CPU.Build.0 = Debug|Any CPU
54+
{DCAE8241-E391-418D-BA36-C7C064D7C413}.Release|Any CPU.ActiveCfg = Release|Any CPU
55+
{DCAE8241-E391-418D-BA36-C7C064D7C413}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{0F10190C-7611-4378-A157-03BF2ED78E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57+
{0F10190C-7611-4378-A157-03BF2ED78E30}.Debug|Any CPU.Build.0 = Debug|Any CPU
58+
{0F10190C-7611-4378-A157-03BF2ED78E30}.Release|Any CPU.ActiveCfg = Release|Any CPU
59+
{0F10190C-7611-4378-A157-03BF2ED78E30}.Release|Any CPU.Build.0 = Release|Any CPU
60+
{E2828AC4-3C63-4B2A-B5AD-5F98862775BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61+
{E2828AC4-3C63-4B2A-B5AD-5F98862775BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
62+
{E2828AC4-3C63-4B2A-B5AD-5F98862775BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
63+
{E2828AC4-3C63-4B2A-B5AD-5F98862775BE}.Release|Any CPU.Build.0 = Release|Any CPU
64+
{56137079-541A-425A-AB97-43AF63793C97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65+
{56137079-541A-425A-AB97-43AF63793C97}.Debug|Any CPU.Build.0 = Debug|Any CPU
66+
{56137079-541A-425A-AB97-43AF63793C97}.Release|Any CPU.ActiveCfg = Release|Any CPU
67+
{56137079-541A-425A-AB97-43AF63793C97}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{CEE5E7E1-1BF0-4BE1-9941-903262CE2F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69+
{CEE5E7E1-1BF0-4BE1-9941-903262CE2F83}.Debug|Any CPU.Build.0 = Debug|Any CPU
70+
{CEE5E7E1-1BF0-4BE1-9941-903262CE2F83}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{CEE5E7E1-1BF0-4BE1-9941-903262CE2F83}.Release|Any CPU.Build.0 = Release|Any CPU
72+
{4E7819E8-7555-4E2E-9A01-D8718A2CFDDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
73+
{4E7819E8-7555-4E2E-9A01-D8718A2CFDDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
74+
{4E7819E8-7555-4E2E-9A01-D8718A2CFDDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
75+
{4E7819E8-7555-4E2E-9A01-D8718A2CFDDA}.Release|Any CPU.Build.0 = Release|Any CPU
76+
{42173642-DB52-44D3-9883-3E34C65C53BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77+
{42173642-DB52-44D3-9883-3E34C65C53BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
78+
{42173642-DB52-44D3-9883-3E34C65C53BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
79+
{42173642-DB52-44D3-9883-3E34C65C53BC}.Release|Any CPU.Build.0 = Release|Any CPU
80+
{9FC2F0B3-A8D2-46DA-8724-72E00E67A8FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
81+
{9FC2F0B3-A8D2-46DA-8724-72E00E67A8FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
82+
{9FC2F0B3-A8D2-46DA-8724-72E00E67A8FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
83+
{9FC2F0B3-A8D2-46DA-8724-72E00E67A8FA}.Release|Any CPU.Build.0 = Release|Any CPU
84+
{F9880DC4-F015-4413-AF86-66D0E9512774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
85+
{F9880DC4-F015-4413-AF86-66D0E9512774}.Debug|Any CPU.Build.0 = Debug|Any CPU
86+
{F9880DC4-F015-4413-AF86-66D0E9512774}.Release|Any CPU.ActiveCfg = Release|Any CPU
87+
{F9880DC4-F015-4413-AF86-66D0E9512774}.Release|Any CPU.Build.0 = Release|Any CPU
88+
{14A163C0-0054-480D-A096-EDA51DD933EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
89+
{14A163C0-0054-480D-A096-EDA51DD933EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
90+
{14A163C0-0054-480D-A096-EDA51DD933EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
91+
{14A163C0-0054-480D-A096-EDA51DD933EA}.Release|Any CPU.Build.0 = Release|Any CPU
92+
{D015A3AA-613C-45D9-B908-7D47C4B613AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
93+
{D015A3AA-613C-45D9-B908-7D47C4B613AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
94+
{D015A3AA-613C-45D9-B908-7D47C4B613AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
95+
{D015A3AA-613C-45D9-B908-7D47C4B613AF}.Release|Any CPU.Build.0 = Release|Any CPU
96+
{6FE2F714-6B3E-4B20-8C70-28BFCE084ED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
97+
{6FE2F714-6B3E-4B20-8C70-28BFCE084ED2}.Debug|Any CPU.Build.0 = Debug|Any CPU
98+
{6FE2F714-6B3E-4B20-8C70-28BFCE084ED2}.Release|Any CPU.ActiveCfg = Release|Any CPU
99+
{6FE2F714-6B3E-4B20-8C70-28BFCE084ED2}.Release|Any CPU.Build.0 = Release|Any CPU
100+
{52A93D37-60D7-4607-8BB2-724D9C46671B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
101+
{52A93D37-60D7-4607-8BB2-724D9C46671B}.Debug|Any CPU.Build.0 = Debug|Any CPU
102+
{52A93D37-60D7-4607-8BB2-724D9C46671B}.Release|Any CPU.ActiveCfg = Release|Any CPU
103+
{52A93D37-60D7-4607-8BB2-724D9C46671B}.Release|Any CPU.Build.0 = Release|Any CPU
104+
{02E54061-EB72-409D-B2C0-307CE66B57E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105+
{02E54061-EB72-409D-B2C0-307CE66B57E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
106+
{02E54061-EB72-409D-B2C0-307CE66B57E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
107+
{02E54061-EB72-409D-B2C0-307CE66B57E9}.Release|Any CPU.Build.0 = Release|Any CPU
108+
{9AD347A8-EA5B-462B-810C-998F04471BB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109+
{9AD347A8-EA5B-462B-810C-998F04471BB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
110+
{9AD347A8-EA5B-462B-810C-998F04471BB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
111+
{9AD347A8-EA5B-462B-810C-998F04471BB7}.Release|Any CPU.Build.0 = Release|Any CPU
112+
{B7C0E021-71AC-4C97-9A51-8356F1BD53C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
113+
{B7C0E021-71AC-4C97-9A51-8356F1BD53C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
114+
{B7C0E021-71AC-4C97-9A51-8356F1BD53C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
115+
{B7C0E021-71AC-4C97-9A51-8356F1BD53C7}.Release|Any CPU.Build.0 = Release|Any CPU
116+
{BE15BDF3-B184-4E2F-8459-EBEE3160E19D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
117+
{BE15BDF3-B184-4E2F-8459-EBEE3160E19D}.Debug|Any CPU.Build.0 = Debug|Any CPU
118+
{BE15BDF3-B184-4E2F-8459-EBEE3160E19D}.Release|Any CPU.ActiveCfg = Release|Any CPU
119+
{BE15BDF3-B184-4E2F-8459-EBEE3160E19D}.Release|Any CPU.Build.0 = Release|Any CPU
120+
{DDEC35D2-5781-471D-5EA1-A6E433EDDB11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121+
{DDEC35D2-5781-471D-5EA1-A6E433EDDB11}.Debug|Any CPU.Build.0 = Debug|Any CPU
122+
{DDEC35D2-5781-471D-5EA1-A6E433EDDB11}.Release|Any CPU.ActiveCfg = Release|Any CPU
123+
{DDEC35D2-5781-471D-5EA1-A6E433EDDB11}.Release|Any CPU.Build.0 = Release|Any CPU
124+
{EA3251AA-1452-3815-1A43-0041AEDEA112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
125+
{EA3251AA-1452-3815-1A43-0041AEDEA112}.Debug|Any CPU.Build.0 = Debug|Any CPU
126+
{EA3251AA-1452-3815-1A43-0041AEDEA112}.Release|Any CPU.ActiveCfg = Release|Any CPU
127+
{EA3251AA-1452-3815-1A43-0041AEDEA112}.Release|Any CPU.Build.0 = Release|Any CPU
128+
{8636F290-00DF-403E-B841-E4BFD6D9CE7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
129+
{8636F290-00DF-403E-B841-E4BFD6D9CE7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
130+
{8636F290-00DF-403E-B841-E4BFD6D9CE7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
131+
{8636F290-00DF-403E-B841-E4BFD6D9CE7A}.Release|Any CPU.Build.0 = Release|Any CPU
132+
{ED35E7A1-5725-3258-3A99-AB356EDD5844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
133+
{ED35E7A1-5725-3258-3A99-AB356EDD5844}.Debug|Any CPU.Build.0 = Debug|Any CPU
134+
{ED35E7A1-5725-3258-3A99-AB356EDD5844}.Release|Any CPU.ActiveCfg = Release|Any CPU
135+
{ED35E7A1-5725-3258-3A99-AB356EDD5844}.Release|Any CPU.Build.0 = Release|Any CPU
136+
EndGlobalSection
137+
GlobalSection(SolutionProperties) = preSolution
138+
HideSolutionNode = FALSE
139+
EndGlobalSection
140+
EndGlobal

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.1.0")]
18-
[assembly: AssemblyFileVersion("7.1.1.0")]
19-
[assembly: AssemblyInformationalVersion("7.1.1")]
17+
[assembly: AssemblyVersion("7.1.2.0")]
18+
[assembly: AssemblyFileVersion("7.1.2.0")]
19+
[assembly: AssemblyInformationalVersion("7.1.2")]
2020

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

itext.tests/itext.barcodes.tests/itext/barcodes/BarcodeMSITest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ source product.
4141
4242
*/
4343
using System;
44+
using iText.IO.Util;
4445
using iText.Kernel.Colors;
4546
using iText.Kernel.Pdf;
4647
using iText.Kernel.Pdf.Canvas;
@@ -103,7 +104,7 @@ public virtual void Barcode03Test() {
103104
byte[] expected = new byte[] { 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1,
104105
0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 };
105106
byte[] barcodeBytes = BarcodeMSI.GetBarsMSI("1234");
106-
bool isEqual = iText.IO.Util.JavaUtil.ArraysEquals(expected, barcodeBytes);
107+
bool isEqual = JavaUtil.ArraysEquals(expected, barcodeBytes);
107108
NUnit.Framework.Assert.IsTrue(isEqual);
108109
}
109110

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.1.0")]
18-
[assembly: AssemblyFileVersion("7.1.1.0")]
19-
[assembly: AssemblyInformationalVersion("7.1.1")]
17+
[assembly: AssemblyVersion("7.1.2.0")]
18+
[assembly: AssemblyFileVersion("7.1.2.0")]
19+
[assembly: AssemblyInformationalVersion("7.1.2")]
2020

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

itext.tests/itext.forms.tests/itext/forms/FormFieldFlatteningTest.cs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,22 @@ public virtual void FormFlatteningTest01() {
6969
PdfAcroForm form = PdfAcroForm.GetAcroForm(doc, true);
7070
form.FlattenFields();
7171
doc.Close();
72+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(filename, sourceFolder + "cmp_formFlatteningTest01.pdf"
73+
, destinationFolder, "diff_"));
74+
}
75+
76+
/// <exception cref="System.IO.IOException"/>
77+
/// <exception cref="System.Exception"/>
78+
[NUnit.Framework.Test]
79+
public virtual void FormFlatteningChoiceFieldTest01() {
80+
String srcFilename = sourceFolder + "formFlatteningSourceChoiceField.pdf";
81+
String filename = destinationFolder + "formFlatteningChoiceFieldTest01.pdf";
82+
PdfDocument doc = new PdfDocument(new PdfReader(srcFilename), new PdfWriter(filename));
83+
PdfAcroForm form = PdfAcroForm.GetAcroForm(doc, true);
84+
form.FlattenFields();
85+
doc.Close();
7286
CompareTool compareTool = new CompareTool();
73-
String errorMessage = compareTool.CompareByContent(filename, sourceFolder + "cmp_formFlatteningTest01.pdf"
87+
String errorMessage = compareTool.CompareByContent(filename, sourceFolder + "cmp_formFlatteningChoiceFieldTest01.pdf"
7488
, destinationFolder, "diff_");
7589
if (errorMessage != null) {
7690
NUnit.Framework.Assert.Fail(errorMessage);
@@ -94,11 +108,7 @@ public virtual void FormFlatteningTest_DefaultAppearanceGeneration_Rot0() {
94108
}
95109
form.FlattenFields();
96110
doc.Close();
97-
CompareTool compareTool = new CompareTool();
98-
String errorMessage = compareTool.CompareByContent(dest, cmp, destinationFolder, "diff_");
99-
if (errorMessage != null) {
100-
NUnit.Framework.Assert.Fail(errorMessage);
101-
}
111+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
102112
}
103113
}
104114

@@ -119,11 +129,7 @@ public virtual void FormFlatteningTest_DefaultAppearanceGeneration_Rot90() {
119129
}
120130
form.FlattenFields();
121131
doc.Close();
122-
CompareTool compareTool = new CompareTool();
123-
String errorMessage = compareTool.CompareByContent(dest, cmp, destinationFolder, "diff_");
124-
if (errorMessage != null) {
125-
NUnit.Framework.Assert.Fail(errorMessage);
126-
}
132+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
127133
}
128134
}
129135

@@ -144,11 +150,7 @@ public virtual void FormFlatteningTest_DefaultAppearanceGeneration_Rot180() {
144150
}
145151
form.FlattenFields();
146152
doc.Close();
147-
CompareTool compareTool = new CompareTool();
148-
String errorMessage = compareTool.CompareByContent(dest, cmp, destinationFolder, "diff_");
149-
if (errorMessage != null) {
150-
NUnit.Framework.Assert.Fail(errorMessage);
151-
}
153+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
152154
}
153155
}
154156

@@ -169,11 +171,7 @@ public virtual void FormFlatteningTest_DefaultAppearanceGeneration_Rot270() {
169171
}
170172
form.FlattenFields();
171173
doc.Close();
172-
CompareTool compareTool = new CompareTool();
173-
String errorMessage = compareTool.CompareByContent(dest, cmp, destinationFolder, "diff_");
174-
if (errorMessage != null) {
175-
NUnit.Framework.Assert.Fail(errorMessage);
176-
}
174+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(dest, cmp, destinationFolder, "diff_"));
177175
}
178176
}
179177
}

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,5 +360,26 @@ public virtual void RegenerateAppearance2() {
360360
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + output, sourceFolder
361361
+ "cmp_" + output, destinationFolder, "diff"));
362362
}
363+
364+
/// <exception cref="System.IO.IOException"/>
365+
/// <exception cref="System.Exception"/>
366+
[NUnit.Framework.Test]
367+
public virtual void MultilineTextFieldWithAlignmentTest() {
368+
String outPdf = destinationFolder + "multilineTextFieldWithAlignment.pdf";
369+
String cmpPdf = sourceFolder + "cmp_multilineTextFieldWithAlignment.pdf";
370+
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outPdf));
371+
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true);
372+
Rectangle rect = new Rectangle(210, 600, 150, 100);
373+
PdfTextFormField field = PdfFormField.CreateMultilineText(pdfDoc, rect, "fieldName", "some value\nsecond line\nthird"
374+
);
375+
field.SetJustification(PdfTextFormField.ALIGN_RIGHT);
376+
form.AddField(field);
377+
pdfDoc.Close();
378+
CompareTool compareTool = new CompareTool();
379+
String errorMessage = compareTool.CompareByContent(outPdf, cmpPdf, destinationFolder, "diff_");
380+
if (errorMessage != null) {
381+
NUnit.Framework.Assert.Fail(errorMessage);
382+
}
383+
}
363384
}
364385
}

0 commit comments

Comments
 (0)