Skip to content

Commit 0838772

Browse files
committed
[RELEASE] iText pdfHtml 5.0.2
2 parents a50991c + 2aa6c07 commit 0838772

File tree

197 files changed

+9870
-159
lines changed

Some content is hidden

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

197 files changed

+9870
-159
lines changed

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to iText 7 Community
1+
# Contributing to iText Community
22

3-
We'd love for you to contribute to our source code and to make **iText 7 Community** even better than it is
3+
We'd love for you to contribute to our source code and to make **iText Community** even better than it is
44
today! Here are the guidelines we'd like you to follow:
55

66
- [Question or Problem?](#question)
@@ -15,7 +15,7 @@ today! Here are the guidelines we'd like you to follow:
1515

1616
## <a name="question">Got a Question or Problem?</a>
1717

18-
If you have questions about how to use **iText 7 Community**, please direct these to [Stack Overflow][stackoverflow].
18+
If you have questions about how to use **iText Community**, please direct these to [Stack Overflow][stackoverflow].
1919

2020
If you are a customer with a [support agreement][support], you also have direct access to our JIRA and our developers.
2121

@@ -55,7 +55,7 @@ chances of your issue being dealt with quickly:
5555
* **Related Issues** - has a similar issue been reported before?
5656
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
5757
causing the problem (line of code or commit)
58-
* **Tag the question** - add the tag `itext7` to your question so we can find it.
58+
* **Tag the question** - add the tag `itext` to your question so we can find it.
5959

6060
**If you get help, help others. Good karma rulez!**
6161

@@ -79,7 +79,7 @@ Before you submit your pull request consider the following guidelines:
7979
* Build your changes locally to ensure all the tests pass.
8080
* Push your changes to your GitHub account.
8181
* Create a pull request in GitHub.
82-
"Head fork" should be your repository, and the "base fork" should be the iText7 official repository.
82+
"Head fork" should be your repository, and the "base fork" should be the iText official repository.
8383
* If we suggest changes then:
8484
* Make the required updates.
8585
* Fix up your commits if needed, with an interactive rebase.
@@ -111,7 +111,7 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
111111

112112
We have guidelines on how our git commit messages should be formatted. This leads to **more
113113
readable messages** that are easy to follow when looking through the **project history**. But also,
114-
we use the git commit messages to **generate the iText 7 Community change log**.
114+
we use the git commit messages to **generate the iText Community change log**.
115115

116116
These guidelines were taken from Chris Beams' blog post [How to Write a Git Commit Message][git-commit].
117117

@@ -169,7 +169,7 @@ We use the [Stack Exchange][stackoverflow] network for free support and [GitHub]
169169
[javadocs]: https://itextpdf.com/api
170170
[pull]: https://github.com/itext/i7n-pdfhtml/pulls
171171
[sscce]: http://sscce.org/
172-
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext7
172+
[stackoverflow]: https://stackoverflow.com/questions/tagged/itext
173173
[good-questions]: https://stackoverflow.com/help/how-to-ask
174174
[mcve]: https://stackoverflow.com/help/mcve
175175
[support]: https://itextpdf.com/support

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
**[pdfHtml][pdfHtml]** is an [iText 7][itext] add on.
1+
**[pdfHtml][pdfHtml]** is an [iText][itext] add on.
22

33
This add on will allow you to easily convert HTML to PDF or iText objects.
44

@@ -33,4 +33,4 @@ These activities include:
3333
[latest]: https://github.com/itext/i7n-pdfhtml/releases/latest
3434
[sales]: http://itextpdf.com/sales
3535
[gratis]: https://en.wikipedia.org/wiki/Gratis_versus_libre
36-
[pdfHtml]: http://itextpdf.com/itext7/pdfHtml
36+
[pdfHtml]: https://itextpdf.com/products/convert-html-css-to-pdf-pdfhtml

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 = "pdfHTML 5.0.1 API"
35+
PROJECT_NAME = "pdfHTML 5.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.tests/itext.html2pdf.tests/Properties/AssemblyInfo.cs

+3-3
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("5.0.1.0")]
19-
[assembly: AssemblyFileVersion("5.0.1.0")]
20-
[assembly: AssemblyInformationalVersion("5.0.1")]
18+
[assembly: AssemblyVersion("5.0.2.0")]
19+
[assembly: AssemblyFileVersion("5.0.2.0")]
20+
[assembly: AssemblyInformationalVersion("5.0.2")]
2121

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

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
48-
<PackageReference Include="itext" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
48+
<PackageReference Include="itext" Version="8.0.2" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
4949
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj')" />
5050
<ProjectReference Include="..\..\..\itextcore\itext\itext.layout\itext.layout.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.layout\itext.layout.csproj')" />
5151
<ProjectReference Include="..\..\..\itextcore\itext\itext.forms\itext.forms.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.forms\itext.forms.csproj')" />
5252
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdfa\itext.pdfa.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdfa\itext.pdfa.csproj')" />
5353
<ProjectReference Include="..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
54-
<PackageReference Include="itext.hyph" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
54+
<PackageReference Include="itext.hyph" Version="8.0.2" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
5555
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
56-
<PackageReference Include="itext.pdftest" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
56+
<PackageReference Include="itext.pdftest" Version="8.0.2" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
5757
<ProjectReference Include="..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
58-
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
58+
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.2" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
5959
<ProjectReference Include="..\..\..\itextcore\itext\itext.styledxmlparser\itext.styledxmlparser.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.styledxmlparser\itext.styledxmlparser.csproj')" />
6060
<ProjectReference Include="..\..\..\itextcore\itext\itext.svg\itext.svg.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.svg\itext.svg.csproj')" />
6161
<ProjectReference Include="..\..\itext\itext.html2pdf\itext.html2pdf.csproj" />

itext.tests/itext.html2pdf.tests/itext/html2pdf/FontProviderTest.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public virtual void ConvertStandardFonts() {
6767
HtmlConverter.ConvertToPdf(new FileInfo(SOURCE_FOLDER + "convertStandardFonts.html"), new FileInfo(DESTINATION_FOLDER
6868
+ "convertStandardFonts.pdf"));
6969
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(DESTINATION_FOLDER + "convertStandardFonts.pdf"
70-
, SOURCE_FOLDER + "cmp_convertStandardFonts", DESTINATION_FOLDER, "difffontstand_"));
70+
, SOURCE_FOLDER + "cmp_convertStandardFonts.pdf", DESTINATION_FOLDER, "difffontstand_"));
7171
}
7272

7373
[NUnit.Framework.Test]
@@ -138,5 +138,17 @@ public virtual void ComparatorErrorTest() {
138138
, SOURCE_FOLDER + "cmp_comparatorError.pdf", DESTINATION_FOLDER));
139139
}
140140
}
141+
142+
[NUnit.Framework.Test]
143+
public virtual void DifferentFontFamiliesTest() {
144+
ConverterProperties properties = new ConverterProperties();
145+
FontProvider fontProvider = new DefaultFontProvider(false, false, false);
146+
fontProvider.AddDirectory(SOURCE_FOLDER + "Lato_fonts");
147+
properties.SetFontProvider(fontProvider);
148+
HtmlConverter.ConvertToPdf(new FileInfo(SOURCE_FOLDER + "differentFontFamilies.html"), new FileInfo(DESTINATION_FOLDER
149+
+ "differentFontFamilies.pdf"), properties);
150+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(DESTINATION_FOLDER + "differentFontFamilies.pdf"
151+
, SOURCE_FOLDER + "cmp_differentFontFamilies.pdf", DESTINATION_FOLDER, "diff_"));
152+
}
141153
}
142154
}

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

+57-6
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ Any convert to elements workflow of course doesn't have a PdfDocument.
159159
[NUnit.Framework.Test]
160160
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI
161161
, Count = 1)]
162-
[LogMessage(Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, Count = 1)]
163-
[LogMessage(Html2PdfLogMessageConstant.PDF_DOCUMENT_NOT_PRESENT, Count = 1)]
162+
[LogMessage(Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER)]
164163
public virtual void HtmlObjectMalformedUrlTest() {
165164
String html = "<object data ='htt://as' type='image/svg+xml'></object>";
166165
IList<IElement> lst = HtmlConverter.ConvertToElements(html);
@@ -279,14 +278,66 @@ public virtual void ConvertToElementsAndCreateTwoDocumentsTest() {
279278
}
280279

281280
[NUnit.Framework.Test]
282-
//TODO: DEVSIX-3891 change the Assert after supporting the svg tag
283-
[LogMessage(Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, LogLevel = LogLevelConstants
284-
.ERROR)]
285281
public virtual void HtmlToElementsSvgTest() {
286282
String html = "<svg height=\"100\" width=\"100\">" + "<circle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"black\" stroke-width=\"3\" fill=\"red\" />"
287283
+ "</svg>";
284+
String cmpPdf = sourceFolder + "cmp_htmlToElementsSvg.pdf";
285+
String outPdf = destinationFolder + "htmlToElementsSvg.pdf";
288286
IList<IElement> lst = HtmlConverter.ConvertToElements(html);
289-
NUnit.Framework.Assert.AreEqual(0, lst.Count);
287+
NUnit.Framework.Assert.AreEqual(1, lst.Count);
288+
using (Document document = new Document(new PdfDocument(new PdfWriter(outPdf)))) {
289+
foreach (IElement element in lst) {
290+
document.Add((Image)element);
291+
}
292+
}
293+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
294+
}
295+
296+
[NUnit.Framework.Test]
297+
public virtual void HtmlToElementsSvgInTheTableTest() {
298+
String html = "<table style=\"border: 1pt solid black\">\n" + " <tr>\n" + " <td>\n" + " <svg height=\"100\" width=\"100\">\n"
299+
+ " <circle cx=\"50\" cy=\"50\" r=\"40\" stroke=\"black\" stroke-width=\"3\" fill=\"red\" />\n"
300+
+ " </svg>\n" + " </td>\n" + " <td>\n" + " test\n" + " </td>\n" + " </tr>\n"
301+
+ "</table>";
302+
String cmpPdf = sourceFolder + "cmp_htmlToElementsSvgInTheTable.pdf";
303+
String outPdf = destinationFolder + "htmlToElementsSvgInTheTable.pdf";
304+
IList<IElement> elements = HtmlConverter.ConvertToElements(html);
305+
using (Document document = new Document(new PdfDocument(new PdfWriter(outPdf)))) {
306+
foreach (IElement element in elements) {
307+
document.Add((IBlockElement)element);
308+
}
309+
}
310+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
311+
}
312+
313+
[NUnit.Framework.Test]
314+
public virtual void HtmlToElementsSvgImgTest() {
315+
String html = "<img src=\"lines.svg\" height=\"500\" width=\"500\"/>";
316+
String cmpPdf = sourceFolder + "cmp_htmlToElementsSvgImg.pdf";
317+
String outPdf = destinationFolder + "htmlToElementsSvgImg.pdf";
318+
IList<IElement> elements = HtmlConverter.ConvertToElements(html, new ConverterProperties().SetBaseUri(sourceFolder
319+
));
320+
using (Document document = new Document(new PdfDocument(new PdfWriter(outPdf)))) {
321+
foreach (IElement element in elements) {
322+
document.Add((IBlockElement)element);
323+
}
324+
}
325+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
326+
}
327+
328+
[NUnit.Framework.Test]
329+
public virtual void HtmlToElementsSvgObjectTest() {
330+
String html = "<object data ='lines.svg' type='image/svg+xml'></object>";
331+
String cmpPdf = sourceFolder + "cmp_htmlToElementsSvgObject.pdf";
332+
String outPdf = destinationFolder + "htmlToElementsSvgObject.pdf";
333+
IList<IElement> elements = HtmlConverter.ConvertToElements(html, new ConverterProperties().SetBaseUri(sourceFolder
334+
));
335+
using (Document document = new Document(new PdfDocument(new PdfWriter(outPdf)))) {
336+
foreach (IElement element in elements) {
337+
document.Add((Image)element);
338+
}
339+
}
340+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outPdf, cmpPdf, destinationFolder));
290341
}
291342

292343
private static void AddElementsToDocument(Document document, IList<IElement> elements) {

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/FlexPagingTest.cs

+59-4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ You should have received a copy of the GNU Affero General Public License
2222
*/
2323
using System;
2424
using iText.Html2pdf;
25+
using iText.Test.Attributes;
2526

2627
namespace iText.Html2pdf.Css {
2728
[NUnit.Framework.Category("IntegrationTest")]
@@ -49,13 +50,11 @@ public virtual void ColumnNonPagingTest() {
4950

5051
[NUnit.Framework.Test]
5152
public virtual void ColumnPagingTest() {
52-
//TODO DEVSIX-7622 change files after paging is introduced
5353
ConvertToPdfAndCompare("column-paging", sourceFolder, destinationFolder);
5454
}
5555

5656
[NUnit.Framework.Test]
5757
public virtual void ColumnPagingMultiColumnTest() {
58-
//TODO DEVSIX-7622 change files after paging is introduced
5958
ConvertToPdfAndCompare("column-paging-multi-column", sourceFolder, destinationFolder);
6059
}
6160

@@ -66,19 +65,75 @@ public virtual void ColumnReverseNonPagingTest() {
6665

6766
[NUnit.Framework.Test]
6867
public virtual void ColumnReversePagingTest() {
69-
//TODO DEVSIX-7622 change files after paging is introduced
7068
ConvertToPdfAndCompare("column-reverse-paging", sourceFolder, destinationFolder);
7169
}
7270

7371
[NUnit.Framework.Test]
7472
public virtual void ColumnReversePagingMultiColumnTest() {
75-
//TODO DEVSIX-7622 change files after paging is introduced
7673
ConvertToPdfAndCompare("column-reverse-paging-multi-column", sourceFolder, destinationFolder);
7774
}
7875

76+
[NUnit.Framework.Test]
77+
public virtual void ColumnPagingLargeElementTest() {
78+
ConvertToPdfAndCompare("column-paging-large-element", sourceFolder, destinationFolder);
79+
}
80+
81+
[NUnit.Framework.Test]
82+
public virtual void ColumnPagingLargeElementFlexEndJustificationTest() {
83+
ConvertToPdfAndCompare("column-paging-large-element-flex-end-justification", sourceFolder, destinationFolder
84+
);
85+
}
86+
87+
[NUnit.Framework.Test]
88+
public virtual void ColumnPagingLargeElementCenterJustificationTest() {
89+
ConvertToPdfAndCompare("column-paging-large-element-center-justification", sourceFolder, destinationFolder
90+
);
91+
}
92+
93+
[NUnit.Framework.Test]
94+
public virtual void ColumnPagingLargeElementFixedHeightTest() {
95+
ConvertToPdfAndCompare("column-paging-large-element-fixed-height", sourceFolder, destinationFolder);
96+
}
97+
98+
[NUnit.Framework.Test]
99+
public virtual void ColumnReversePagingLargeElementTest() {
100+
ConvertToPdfAndCompare("column-reverse-paging-large-element", sourceFolder, destinationFolder);
101+
}
102+
79103
[NUnit.Framework.Test]
80104
public virtual void ColumnWrapReverseNonPagingTest() {
81105
ConvertToPdfAndCompare("column-wrap-reverse-non-paging", sourceFolder, destinationFolder);
82106
}
107+
108+
[NUnit.Framework.Test]
109+
[LogMessage(iText.IO.Logs.IoLogMessageConstant.CLIP_ELEMENT)]
110+
public virtual void ColumnPagingInDivTest() {
111+
ConvertToPdfAndCompare("column-paging-in-div", sourceFolder, destinationFolder);
112+
}
113+
114+
[NUnit.Framework.Test]
115+
public virtual void ColumnPagingFixedHeightTest() {
116+
ConvertToPdfAndCompare("column-paging-fixed-height", sourceFolder, destinationFolder);
117+
}
118+
119+
[NUnit.Framework.Test]
120+
public virtual void ColumnNoWrapPagingTest() {
121+
ConvertToPdfAndCompare("column-nowrap-paging", sourceFolder, destinationFolder);
122+
}
123+
124+
[NUnit.Framework.Test]
125+
public virtual void ColumnFlexShrinkPagingTest() {
126+
ConvertToPdfAndCompare("column-flex-shrink-paging", sourceFolder, destinationFolder);
127+
}
128+
129+
[NUnit.Framework.Test]
130+
public virtual void ColumnFlexGrowPagingTest() {
131+
ConvertToPdfAndCompare("column-flex-grow-paging", sourceFolder, destinationFolder);
132+
}
133+
134+
[NUnit.Framework.Test]
135+
public virtual void ColumnFlexGrowPaging2Test() {
136+
ConvertToPdfAndCompare("column-flex-grow-paging-2", sourceFolder, destinationFolder);
137+
}
83138
}
84139
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/VerticalAlignmentTest.cs

-3
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,16 @@ public virtual void VerticalAlignmentTest12() {
101101
}
102102

103103
[NUnit.Framework.Test]
104-
[NUnit.Framework.Ignore("DEVSIX-1750")]
105104
public virtual void VerticalAlignmentTest13() {
106105
ConvertToPdfAndCompare("verticalAlignmentTest13", sourceFolder, destinationFolder);
107106
}
108107

109108
[NUnit.Framework.Test]
110-
[NUnit.Framework.Ignore("DEVSIX-1750")]
111109
public virtual void VerticalAlignmentTest14() {
112110
ConvertToPdfAndCompare("verticalAlignmentTest14", sourceFolder, destinationFolder);
113111
}
114112

115113
[NUnit.Framework.Test]
116-
[NUnit.Framework.Ignore("DEVSIX-1750")]
117114
public virtual void VerticalAlignmentTest15() {
118115
ConvertToPdfAndCompare("verticalAlignmentTest15", sourceFolder, destinationFolder);
119116
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/apply/util/TextDecorationApplierUtilTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ You should have received a copy of the GNU Affero General Public License
2727
using iText.Test;
2828

2929
namespace iText.Html2pdf.Css.Apply.Util {
30+
[NUnit.Framework.Category("UnitTest")]
3031
public class TextDecorationApplierUtilTest : ExtendedITextTest {
3132
private static IElementNode CreateNewNode(IElementNode parent, String color, String line, String decorationStyle
3233
) {

0 commit comments

Comments
 (0)