Skip to content

Commit 6c13914

Browse files
committed
Merge branch '7.1' into develop
# Conflicts: # pom.xml # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest08.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest09.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest10.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest11.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest12.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest13.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest14.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest15.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest16.pdf # src/test/resources/com/itextpdf/html2pdf/css/HeightTest/cmp_heightTest17.pdf # src/test/resources/com/itextpdf/html2pdf/element/TtTest/cmp_TtTest01.pdf Autoported commit. Original commit hash: [e1b550952]
2 parents 1a400fc + e18d3cd commit 6c13914

File tree

1,279 files changed

+6083
-3336
lines changed

Some content is hidden

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

1,279 files changed

+6083
-3336
lines changed

itext.tests/itext.html2pdf.tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

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

18-
[assembly: AssemblyVersion("1.0.3.0")]
19-
[assembly: AssemblyFileVersion("1.0.3.0")]
20-
[assembly: AssemblyInformationalVersion("1.0.3-SNAPSHOT")]
18+
[assembly: AssemblyVersion("1.1.0.0")]
19+
[assembly: AssemblyFileVersion("1.1.0.0")]
20+
[assembly: AssemblyInformationalVersion("1.1.0-SNAPSHOT")]
2121

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

itext.tests/itext.html2pdf.tests/itext.html2pdf.tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
<Reference Include="System.Core" />
4242
</ItemGroup>
4343
<ItemGroup>
44-
<Compile Include="org\jsoup\**\*.cs" />
4544
<Compile Include="itext\html2pdf\**\*.cs" />
4645
<Compile Include="Properties\AssemblyInfo.cs" />
4746
</ItemGroup>

itext.tests/itext.html2pdf.tests/itext/html2pdf/Html2ElementsTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public virtual void HtmlToElementsTest01() {
6565
NUnit.Framework.Assert.IsTrue(lst[0] is Paragraph);
6666
Paragraph p = (Paragraph)lst[0];
6767
NUnit.Framework.Assert.AreEqual("Hello world!", ((Text)p.GetChildren()[0]).GetText());
68-
NUnit.Framework.Assert.AreEqual(12f, (float)(Object)p.GetProperty<float?>(Property.FONT_SIZE), 1e-10);
68+
NUnit.Framework.Assert.AreEqual(12f, p.GetProperty<UnitValue>(Property.FONT_SIZE).GetValue(), 1e-10);
6969
}
7070

7171
/// <exception cref="System.IO.IOException"/>
@@ -79,7 +79,7 @@ public virtual void HtmlToElementsTest02() {
7979
NUnit.Framework.Assert.AreEqual(2, t.GetNumberOfRows());
8080
NUnit.Framework.Assert.AreEqual("123", ((Text)(((Paragraph)t.GetCell(0, 0).GetChildren()[0]).GetChildren()
8181
[0])).GetText());
82-
NUnit.Framework.Assert.AreEqual(24f, (float)(Object)t.GetProperty<float?>(Property.FONT_SIZE), 1e-10);
82+
NUnit.Framework.Assert.AreEqual(24f, t.GetProperty<UnitValue>(Property.FONT_SIZE).GetValue(), 1e-10);
8383
}
8484

8585
/// <exception cref="System.IO.IOException"/>

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/CssStylesResolvingTest.cs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static void BeforeClass() {
6767
[NUnit.Framework.Test]
6868
public virtual void CollectStylesDeclarationsTest01() {
6969
Test("collectStylesDeclarationsTest01.html", "html body p", "color: red", "text-align: center", "font-size: 11.25pt"
70-
, "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: helvetica"
70+
, "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: times-roman"
7171
);
7272
}
7373

@@ -76,64 +76,64 @@ public virtual void CollectStylesDeclarationsTest01() {
7676
public virtual void CollectStylesDeclarationsTest02() {
7777
Test("collectStylesDeclarationsTest02.html", "html body p", "color: blue", "text-align: center", "font-style: italic"
7878
, "font-size: 11.25pt", "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em",
79-
"display: block", "font-family: helvetica");
79+
"display: block", "font-family: times-roman");
8080
}
8181

8282
/// <exception cref="System.IO.IOException"/>
8383
[NUnit.Framework.Test]
8484
public virtual void CollectStylesDeclarationsTest03() {
8585
Test("collectStylesDeclarationsTest03.html", "html body p", "color: red", "text-align: right", "font-size: 7.5pt"
86-
, "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: helvetica"
86+
, "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: times-roman"
8787
);
8888
}
8989

9090
/// <exception cref="System.IO.IOException"/>
9191
[NUnit.Framework.Test]
9292
public virtual void StylesInheritanceTest01() {
9393
Test("stylesInheritanceTest01.html", "html body p span", "color: blue", "text-align: center", "font-style: italic"
94-
, "font-size: 11.25pt", "font-family: helvetica");
94+
, "font-size: 11.25pt", "font-family: times-roman");
9595
}
9696

9797
/// <exception cref="System.IO.IOException"/>
9898
[NUnit.Framework.Test]
9999
public virtual void StylesInheritanceTest02() {
100100
Test("stylesInheritanceTest02.html", "html body p span", "color: black", "text-align: center", "font-style: italic"
101-
, "font-size: 11.25pt", "font-family: helvetica");
101+
, "font-size: 11.25pt", "font-family: times-roman");
102102
}
103103

104104
/// <exception cref="System.IO.IOException"/>
105105
[NUnit.Framework.Test]
106106
public virtual void StylesInheritanceTest03() {
107-
Test("stylesInheritanceTest03.html", "html body p span", "color: green", "font-size: 12.0pt", "font-family: helvetica"
107+
Test("stylesInheritanceTest03.html", "html body p span", "color: green", "font-size: 12.0pt", "font-family: times-roman"
108108
);
109109
}
110110

111111
/// <exception cref="System.IO.IOException"/>
112112
[NUnit.Framework.Test]
113113
public virtual void StylesInheritanceTest04() {
114-
Test("stylesInheritanceTest04.html", "html body p span", "color: blue", "font-size: 12.0pt", "font-family: helvetica"
114+
Test("stylesInheritanceTest04.html", "html body p span", "color: blue", "font-size: 12.0pt", "font-family: times-roman"
115115
);
116116
}
117117

118118
/// <exception cref="System.IO.IOException"/>
119119
[NUnit.Framework.Test]
120120
public virtual void StylesInheritanceTest05() {
121-
Test("stylesInheritanceTest05.html", "html body p span", "color: black", "font-size: 12.0pt", "font-family: helvetica"
121+
Test("stylesInheritanceTest05.html", "html body p span", "color: black", "font-size: 12.0pt", "font-family: times-roman"
122122
);
123123
}
124124

125125
/// <exception cref="System.IO.IOException"/>
126126
[NUnit.Framework.Test]
127127
public virtual void StylesInheritanceTest06() {
128128
Test("stylesInheritanceTest06.html", "html body p span", "margin-left: 20px", "margin-right: 0", "background-color: yellow"
129-
, "font-size: 12.0pt", "font-family: helvetica");
129+
, "font-size: 12.0pt", "font-family: times-roman");
130130
}
131131

132132
/// <exception cref="System.IO.IOException"/>
133133
[NUnit.Framework.Test]
134134
public virtual void StylesInheritanceTest07() {
135135
Test("stylesInheritanceTest07.html", "html body div p span", "margin-left: 0", "padding-top: 10px", "background-color: yellow"
136-
, "font-size: 12.0pt", "font-family: helvetica");
136+
, "font-size: 12.0pt", "font-family: times-roman");
137137
}
138138

139139
/// <exception cref="System.IO.IOException"/>
@@ -143,37 +143,39 @@ public virtual void StylesShorthandsTest01() {
143143
, "border-left-style: dashed", "border-left-width: 5px", "border-right-style: dashed", "border-right-width: 5px"
144144
, "border-top-style: dashed", "border-top-width: 5px", "border-bottom-color: red", "border-left-color: red"
145145
, "border-right-color: red", "border-top-color: red", "font-size: 12.0pt", "margin-bottom: 1em", "margin-left: 0"
146-
, "margin-right: 0", "margin-top: 1em", "display: block", "font-family: helvetica");
146+
, "margin-right: 0", "margin-top: 1em", "display: block", "font-family: times-roman");
147147
}
148148

149149
/// <exception cref="System.IO.IOException"/>
150150
[NUnit.Framework.Test]
151151
public virtual void HtmlStylesConvertingTest01() {
152152
Test("htmlStylesConvertingTest01.html", "html body b p", "font-weight: bold", "font-size: 12.0pt", "margin-bottom: 1em"
153-
, "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: helvetica");
153+
, "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: times-roman"
154+
);
154155
}
155156

156157
/// <exception cref="System.IO.IOException"/>
157158
[NUnit.Framework.Test]
158159
public virtual void HtmlStylesConvertingTest02() {
159160
Test("htmlStylesConvertingTest01.html", "html body b i p", "font-weight: bold", "font-style: italic", "font-size: 12.0pt"
160-
, "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: helvetica"
161+
, "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: times-roman"
161162
);
162163
}
163164

164165
/// <exception cref="System.IO.IOException"/>
165166
[NUnit.Framework.Test]
166167
public virtual void HtmlStylesConvertingTest03() {
167168
Test("htmlStylesConvertingTest01.html", "html body i p", "font-style: italic", "font-size: 12.0pt", "margin-bottom: 1em"
168-
, "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: helvetica");
169+
, "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block", "font-family: times-roman"
170+
);
169171
}
170172

171173
/// <exception cref="System.IO.IOException"/>
172174
[NUnit.Framework.Test]
173175
public virtual void HtmlStylesConvertingTest04() {
174176
Test("htmlStylesConvertingTest01.html", "html body i center p", "font-style: italic", "text-align: center"
175177
, "font-size: 12.0pt", "margin-bottom: 1em", "margin-left: 0", "margin-right: 0", "margin-top: 1em", "display: block"
176-
, "font-family: helvetica");
178+
, "font-family: times-roman");
177179
}
178180

179181
/// <exception cref="System.IO.IOException"/>
@@ -182,14 +184,14 @@ public virtual void HtmlStylesConvertingTest05() {
182184
Test("htmlStylesConvertingTest05.html", "html body table", "border-bottom-style: solid", "border-left-style: solid"
183185
, "border-right-style: solid", "border-top-style: solid", "border-bottom-width: 2px", "border-left-width: 2px"
184186
, "border-right-width: 2px", "border-top-width: 2px", "font-size: 12.0pt", "margin-bottom: 0", "margin-left: 0"
185-
, "margin-right: 0", "margin-top: 0", "text-indent: 0", "display: table", "font-family: helvetica");
187+
, "margin-right: 0", "margin-top: 0", "text-indent: 0", "display: table", "font-family: times-roman");
186188
}
187189

188190
/// <exception cref="System.IO.IOException"/>
189191
[NUnit.Framework.Test]
190192
public virtual void HtmlStylesConvertingTest06() {
191193
Test("htmlStylesConvertingTest05.html", "html body table tbody tr", "background-color: yellow", "font-size: 12.0pt"
192-
, "text-indent: 0", "vertical-align: middle", "display: table-row", "font-family: helvetica");
194+
, "text-indent: 0", "vertical-align: middle", "display: table-row", "font-family: times-roman");
193195
}
194196

195197
/// <exception cref="System.IO.IOException"/>
@@ -210,7 +212,7 @@ public virtual void HtmlStylesConvertingTest08() {
210212
[NUnit.Framework.Test]
211213
public virtual void HtmlStylesConvertingTest09() {
212214
Test("htmlStylesConvertingTest08.html", "html body div center", "text-align: center", "display: block", "font-size: 12.0pt"
213-
, "font-family: helvetica");
215+
, "font-family: times-roman");
214216
}
215217

216218
/// <exception cref="System.IO.IOException"/>
@@ -224,7 +226,7 @@ public virtual void HtmlStylesConvertingTest10() {
224226
[NUnit.Framework.Test]
225227
public virtual void HtmlStylesConvertingTest11() {
226228
Test("htmlStylesConvertingTest10.html", "html body", "background-color: yellow", "font-size: 12.0pt", "margin-bottom: 10%"
227-
, "margin-left: 10%", "margin-right: 10%", "margin-top: 10%", "display: block", "font-family: helvetica"
229+
, "margin-left: 10%", "margin-right: 10%", "margin-top: 10%", "display: block", "font-family: times-roman"
228230
);
229231
}
230232

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/media/MediaRuleTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ public virtual void Test07() {
201201
(printDevice).SetBaseUri(sourceFolder));
202202
IList<IElement> screenElements = HtmlConverter.ConvertToElements(html, new ConverterProperties().SetMediaDeviceDescription
203203
(screenDevice).SetBaseUri(sourceFolder));
204-
NUnit.Framework.Assert.AreEqual(12f, (float?)printElements[0].GetProperty<float?>(Property.FONT_SIZE), 1e-10f
205-
);
206-
NUnit.Framework.Assert.AreEqual(20f, (float?)screenElements[0].GetProperty<float?>(Property.FONT_SIZE), 1e-10f
207-
);
204+
NUnit.Framework.Assert.AreEqual(12f, printElements[0].GetProperty<UnitValue>(Property.FONT_SIZE).GetValue(
205+
), 1e-10f);
206+
NUnit.Framework.Assert.AreEqual(20f, screenElements[0].GetProperty<UnitValue>(Property.FONT_SIZE).GetValue
207+
(), 1e-10f);
208208
}
209209
}
210210
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/selector/item/SpecificityCalculationTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public virtual void Test18() {
150150

151151
[NUnit.Framework.Test]
152152
public virtual void Test19() {
153-
NUnit.Framework.Assert.AreEqual(CssSpecificityConstants.CLASS_SPECIFICITY * 2, GetSpecificity(".class_name:lang(it)"
153+
NUnit.Framework.Assert.AreEqual(CssSpecificityConstants.CLASS_SPECIFICITY * 2, GetSpecificity(".class_name:hover"
154154
));
155155
}
156156

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/BrTest.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,15 @@ public virtual void Br01Test() {
6868
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + "brTest01.pdf", sourceFolder
6969
+ "cmp_brTest01.pdf", destinationFolder, "diff01_"));
7070
}
71+
72+
/// <exception cref="System.IO.IOException"/>
73+
/// <exception cref="System.Exception"/>
74+
[NUnit.Framework.Test]
75+
public virtual void Br02Test() {
76+
HtmlConverter.ConvertToPdf(new FileInfo(sourceFolder + "brTest02.html"), new FileInfo(destinationFolder +
77+
"brTest02.pdf"));
78+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + "brTest02.pdf", sourceFolder
79+
+ "cmp_brTest02.pdf", destinationFolder, "diff02_"));
80+
}
7181
}
7282
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/LinkTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public virtual void LinkTest09() {
161161
/// <exception cref="System.IO.IOException"/>
162162
/// <exception cref="System.Exception"/>
163163
[NUnit.Framework.Test]
164-
[LogMessage(PdfAConformanceException.CatalogShallContainLangEntry)]
164+
[LogMessage(PdfAConformanceLogMessageConstant.CATALOG_SHOULD_CONTAIN_LANG_ENTRY)]
165165
public virtual void LinkTest10ToPdfa() {
166166
Stream @is = new FileStream(sourceFolder + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read);
167167
PdfADocument pdfADocument = new PdfADocument(new PdfWriter(destinationFolder + "linkTest10.pdf"), PdfAConformanceLevel

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/MetaTest.cs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ public virtual void Meta01Test() {
6868
+ "metaTest01.pdf"));
6969
PdfDocumentInfo pdfDocInfo = new PdfDocument(new PdfReader(destinationFolder + "metaTest01.pdf")).GetDocumentInfo
7070
();
71-
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + "metaTest01.pdf", sourceFolder
71+
CompareTool compareTool = new CompareTool();
72+
NUnit.Framework.Assert.IsNull(compareTool.CompareDocumentInfo(destinationFolder + "metaTest01.pdf", sourceFolder
73+
+ "cmp_metaTest01.pdf"));
74+
NUnit.Framework.Assert.IsNull(compareTool.CompareByContent(destinationFolder + "metaTest01.pdf", sourceFolder
7275
+ "cmp_metaTest01.pdf", destinationFolder, "diff01_"));
73-
NUnit.Framework.Assert.IsTrue(pdfDocInfo.GetPdfObject().ContainsKey(new PdfName("test")));
76+
NUnit.Framework.Assert.AreEqual(pdfDocInfo.GetMoreInfo("test"), "the test content");
7477
}
7578

7679
/// <exception cref="System.IO.IOException"/>
@@ -83,9 +86,17 @@ public virtual void Meta02Test() {
8386
+ "metaTest02.pdf"));
8487
PdfDocumentInfo pdfDocInfo = new PdfDocument(new PdfReader(destinationFolder + "metaTest02.pdf")).GetDocumentInfo
8588
();
86-
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + "metaTest02.pdf", sourceFolder
89+
CompareTool compareTool = new CompareTool();
90+
NUnit.Framework.Assert.IsNull(compareTool.CompareDocumentInfo(destinationFolder + "metaTest02.pdf", sourceFolder
91+
+ "cmp_metaTest02.pdf"));
92+
NUnit.Framework.Assert.IsNull(compareTool.CompareByContent(destinationFolder + "metaTest02.pdf", sourceFolder
8793
+ "cmp_metaTest02.pdf", destinationFolder, "diff02_"));
88-
NUnit.Framework.Assert.IsTrue(pdfDocInfo.GetPdfObject().Size() == 9);
94+
NUnit.Framework.Assert.AreEqual(pdfDocInfo.GetAuthor(), "Bruno Lowagie");
95+
NUnit.Framework.Assert.AreEqual(pdfDocInfo.GetKeywords(), "metadata, keywords, test");
96+
NUnit.Framework.Assert.AreEqual(pdfDocInfo.GetSubject(), "This is the description of the page");
97+
NUnit.Framework.Assert.AreEqual(pdfDocInfo.GetMoreInfo("generator"), "Eugenerator Onegenerator");
98+
NUnit.Framework.Assert.AreEqual(pdfDocInfo.GetMoreInfo("subject"), "Trying to break iText and write pdf's Subject with subject instead of description name"
99+
);
89100
}
90101

91102
/// <exception cref="System.IO.IOException"/>
@@ -94,7 +105,10 @@ public virtual void Meta02Test() {
94105
public virtual void Meta03Test() {
95106
HtmlConverter.ConvertToPdf(new FileInfo(sourceFolder + "metaTest03.html"), new FileInfo(destinationFolder
96107
+ "metaTest03.pdf"));
97-
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + "metaTest03.pdf", sourceFolder
108+
CompareTool compareTool = new CompareTool();
109+
NUnit.Framework.Assert.IsNull(compareTool.CompareDocumentInfo(destinationFolder + "metaTest03.pdf", sourceFolder
110+
+ "cmp_metaTest03.pdf"));
111+
NUnit.Framework.Assert.IsNull(compareTool.CompareByContent(destinationFolder + "metaTest03.pdf", sourceFolder
98112
+ "cmp_metaTest03.pdf", destinationFolder, "diff03_"));
99113
}
100114
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
using System;
22
using System.IO;
33

4-
namespace Org.Jsoup {
4+
namespace iText.Html2pdf.Jsoup {
55
internal class PortTestUtil {
66
public static readonly String sourceFolder =
77
iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext.CurrentContext.TestDirectory) +
88
"/";
99

1010
public static FileInfo GetFile(String filename) {
11-
return new FileInfo(sourceFolder + "resources/org/jsoup" + filename);
11+
return new FileInfo(sourceFolder + "resources/itext/html2pdf/jsoup" + filename);
1212
}
1313
}
1414
}

0 commit comments

Comments
 (0)