Skip to content

Commit a50991c

Browse files
committed
[RELEASE] iText pdfHTML 5.0.1
2 parents 337c0e4 + 9732514 commit a50991c

File tree

2,665 files changed

+58617
-332
lines changed

Some content is hidden

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

2,665 files changed

+58617
-332
lines changed

AppNet.class

-2.76 KB
Binary file not shown.

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.0 API"
35+
PROJECT_NAME = "pdfHTML 5.0.1 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.0.0")]
19-
[assembly: AssemblyFileVersion("5.0.0.0")]
20-
[assembly: AssemblyInformationalVersion("5.0.0")]
18+
[assembly: AssemblyVersion("5.0.1.0")]
19+
[assembly: AssemblyFileVersion("5.0.1.0")]
20+
[assembly: AssemblyInformationalVersion("5.0.1")]
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="itext7" Version="8.0.0" 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')" />
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="itext7.hyph" Version="8.0.0" 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')" />
5555
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
56-
<PackageReference Include="itext7.pdftest" Version="8.0.0" 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')" />
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="itext7.bouncy-castle-adapter" Version="8.0.0" 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')" />
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/ExtendedHtmlConversionITextTest.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ You should have received a copy of the GNU Affero General Public License
2323
using System;
2424
using System.IO;
2525
using iText.Forms;
26+
using iText.Forms.Fields;
2627
using iText.IO.Util;
2728
using iText.Kernel.Pdf;
2829
using iText.Kernel.Utils;
@@ -134,7 +135,7 @@ public virtual void ConvertToPdfAcroformFlattenAndCompare(String name, String so
134135
System.Console.Out.WriteLine("html: " + UrlUtil.GetNormalizedFileUriString(sourceHtml) + "\n");
135136
//flatted created tagged PDF with acroform
136137
PdfDocument document = new PdfDocument(new PdfReader(outPdfPathAcro), new PdfWriter(outPdfPathFlatted));
137-
PdfAcroForm acroForm = PdfAcroForm.GetAcroForm(document, false);
138+
PdfAcroForm acroForm = PdfFormCreator.GetAcroForm(document, false);
138139
acroForm.FlattenFields();
139140
document.Close();
140141
//compare with cmp
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
24+
using System;
25+
using System.Threading;
26+
using System.Threading.Tasks;
27+
using iText.Commons;
28+
using iText.IO.Source;
29+
using iText.Test;
30+
using Microsoft.Extensions.Logging;
31+
using NUnit.Framework;
32+
using ILogger = Microsoft.Extensions.Logging.ILogger;
33+
34+
namespace iText.Html2pdf {
35+
[Category("IntegrationTest")]
36+
public class HtmlConverterMultiThreadedTest : ExtendedITextTest
37+
{
38+
private static readonly ILogger LOGGER = ITextLogManager.GetLogger(typeof(iText.Html2pdf.HtmlConverterMultiThreadedTest
39+
));
40+
41+
private static readonly String SOURCE_FOLDER =
42+
TestUtil.GetParentProjectDirectory(TestContext.CurrentContext.TestDirectory) +
43+
"/resources/itext/html2pdf/HtmlConverterMultiThreadedTest/";
44+
45+
[Test]
46+
public void MultiThreadedHtmlToPdfConversionTest()
47+
{
48+
var runcount = 75;
49+
50+
//Set time limit of 2 seconds
51+
var cts = new CancellationTokenSource();
52+
cts.CancelAfter(2000 * 60);
53+
54+
var options = new ParallelOptions();
55+
options.CancellationToken = cts.Token;
56+
options.MaxDegreeOfParallelism = 100;
57+
58+
ThreadPool.SetMinThreads(runcount, runcount);
59+
60+
var results = new ParallelLoopResult();
61+
62+
try
63+
{
64+
results = Parallel.For(0, runcount, options, (i, state) =>
65+
{
66+
var outStr = new ByteArrayOutputStream();
67+
HtmlConverter.ConvertToPdf(SOURCE_FOLDER + "basicHtml.html", outStr);
68+
});
69+
}
70+
catch (OperationCanceledException e)
71+
{
72+
LOGGER.LogError("Thread timed out after 2 seconds.");
73+
}
74+
finally
75+
{
76+
cts.Dispose();
77+
}
78+
79+
Assert.IsTrue(results.IsCompleted, "Not all tasks were successful.");
80+
}
81+
}
82+
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/ClearTest.cs

+18
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,23 @@ public virtual void ImgWideBorderFloatAmongParaWithSpanTest() {
134134
public virtual void ImgWideBorderClearAndDisplayBlockParaFloatTest() {
135135
ConvertToPdfAndCompare("imgWideBorderClearAndDisplayBlockParaFloat", sourceFolder, destinationFolder);
136136
}
137+
138+
[NUnit.Framework.Test]
139+
public virtual void FloatsPositioningOutsideDivWithClearTest() {
140+
// TODO DEVSIX-7602 Css right and left clear property is processed incorrectly if floats "intersect" by x
141+
ConvertToPdfAndCompare("floatsPositioningOutsideDivWithClear", sourceFolder, destinationFolder);
142+
}
143+
144+
[NUnit.Framework.Test]
145+
public virtual void WideFloatsPositioningOutsideDivWithClearTest() {
146+
// TODO DEVSIX-7602 Css right and left clear property is processed incorrectly for wide floats
147+
ConvertToPdfAndCompare("wideFloatsPositioningOutsideDivWithClear", sourceFolder, destinationFolder);
148+
}
149+
150+
[NUnit.Framework.Test]
151+
public virtual void FloatsWithClearInsideFlexElementTest() {
152+
// TODO DEVSIX-7602 Flex element width is incorrect in case clear property is applied to floats inside it
153+
ConvertToPdfAndCompare("floatsWithClearInsideFlexElement", sourceFolder, destinationFolder);
154+
}
137155
}
138156
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.Html2pdf;
25+
26+
namespace iText.Html2pdf.Css {
27+
[NUnit.Framework.Category("IntegrationTest")]
28+
public class ContinuousContainerTest : ExtendedHtmlConversionITextTest {
29+
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
30+
.CurrentContext.TestDirectory) + "/resources/itext/html2pdf/css/ContinuousContainerTest/";
31+
32+
public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
33+
+ "/test/itext/html2pdf/css/ContinuousContainerTest/";
34+
35+
[NUnit.Framework.OneTimeSetUp]
36+
public static void BeforeClass() {
37+
CreateOrClearDestinationFolder(DESTINATION_FOLDER);
38+
}
39+
40+
[NUnit.Framework.Test]
41+
public virtual void SimpleDivTest() {
42+
RunTest("divTest");
43+
}
44+
45+
[NUnit.Framework.Test]
46+
public virtual void NestedDivTest() {
47+
RunTest("nestedDivTest");
48+
}
49+
50+
[NUnit.Framework.Test]
51+
public virtual void ParagraphTest() {
52+
RunTest("paragraphTest");
53+
}
54+
55+
[NUnit.Framework.Test]
56+
public virtual void TableTest() {
57+
// TODO DEVSIX-7567 Support continuous container for tables (td)
58+
RunTest("tableTest");
59+
}
60+
61+
[NUnit.Framework.Test]
62+
public virtual void ListTest() {
63+
RunTest("listTest");
64+
}
65+
66+
private void RunTest(String testName) {
67+
ConvertToPdfAndCompare(testName, SOURCE_FOLDER, DESTINATION_FOLDER, false, new ConverterProperties().SetContinuousContainerEnabled
68+
(true));
69+
}
70+
}
71+
}

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/DisplayFlexTest.cs

+70-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ You should have received a copy of the GNU Affero General Public License
2626
using iText.Forms.Form.Element;
2727
using iText.Html2pdf;
2828
using iText.Html2pdf.Attach.Impl.Layout;
29-
using iText.Html2pdf.Logs;
3029
using iText.Layout.Element;
3130
using iText.Layout.Properties;
3231
using iText.Layout.Renderer;
@@ -162,9 +161,7 @@ public virtual void BrTagTest() {
162161
}
163162

164163
[NUnit.Framework.Test]
165-
[LogMessage(Html2PdfLogMessageConstant.FLEX_PROPERTY_IS_NOT_SUPPORTED_YET)]
166164
public virtual void FlexWrapTest() {
167-
//TODO DEVSIX-5086 change this test when working on the ticket
168165
String name = "flexWrap";
169166
String sourceHtml = SOURCE_FOLDER + name + ".html";
170167
ConverterProperties converterProperties = new ConverterProperties().SetBaseUri(SOURCE_FOLDER);
@@ -174,7 +171,7 @@ public virtual void FlexWrapTest() {
174171
}
175172
IElement flexContainer = elements[0];
176173
NUnit.Framework.Assert.IsTrue(flexContainer.GetRenderer() is FlexContainerRenderer);
177-
NUnit.Framework.Assert.IsFalse(flexContainer.HasProperty(Property.FLEX_WRAP));
174+
NUnit.Framework.Assert.IsTrue(flexContainer.HasProperty(Property.FLEX_WRAP));
178175
}
179176

180177
[NUnit.Framework.Test]
@@ -446,6 +443,75 @@ public virtual void SplitFlexContainersTest() {
446443
ConvertToPdfAndCompare("flexSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
447444
}
448445

446+
[NUnit.Framework.Test]
447+
public virtual void SplitWrappedFlexContainersTest1() {
448+
ConvertToPdfAndCompare("wrappedFlexStretchSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
449+
}
450+
451+
[NUnit.Framework.Test]
452+
public virtual void SplitWrappedFlexContainersTest2() {
453+
ConvertToPdfAndCompare("wrappedFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
454+
}
455+
456+
[NUnit.Framework.Test]
457+
public virtual void SplitWrappedFlexContainersTest3() {
458+
ConvertToPdfAndCompare("wrappedFlexEndSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
459+
}
460+
461+
[NUnit.Framework.Test]
462+
public virtual void SplitWrappedFlexContainersTest4() {
463+
ConvertToPdfAndCompare("wrappedFlexCenterSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
464+
}
465+
466+
[NUnit.Framework.Test]
467+
public virtual void SplitWrappedFlexContainersTest5() {
468+
ConvertToPdfAndCompare("wrappedReverseFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
469+
}
470+
471+
[NUnit.Framework.Test]
472+
public virtual void SplitWrappedFlexContainersTest6() {
473+
ConvertToPdfAndCompare("wrappedReverseFlexEndSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
474+
}
475+
476+
[NUnit.Framework.Test]
477+
public virtual void SplitWrappedFlexContainersTest7() {
478+
ConvertToPdfAndCompare("wrappedRowReverseFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
479+
}
480+
481+
[NUnit.Framework.Test]
482+
public virtual void SplitWrappedFlexContainersTest8() {
483+
ConvertToPdfAndCompare("wrappedRowReverseFlexEndSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
484+
}
485+
486+
[NUnit.Framework.Test]
487+
[LogMessage(iText.IO.Logs.IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, Ignore = true)]
488+
public virtual void SplitWrappedFlexContainersTest9() {
489+
ConvertToPdfAndCompare("wrappedRowReverseRtlFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
490+
}
491+
492+
[NUnit.Framework.Test]
493+
[LogMessage(iText.IO.Logs.IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, Ignore = true)]
494+
public virtual void SplitWrappedFlexContainersTest10() {
495+
ConvertToPdfAndCompare("wrappedRowRtlFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
496+
}
497+
498+
[NUnit.Framework.Test]
499+
public virtual void EndlessColumnFlexContainerWithPercentFlexBasisTest() {
500+
ConvertToPdfAndCompare("endlessColumnFlexContainerWithPercentFlexBasis", SOURCE_FOLDER, DESTINATION_FOLDER
501+
);
502+
}
503+
504+
[NUnit.Framework.Test]
505+
public virtual void DefiniteMainSizeColumnFlexContainerWithPercentFlexBasisTest() {
506+
ConvertToPdfAndCompare("definiteMainSizeColumnFlexContainerWithPercentFlexBasis", SOURCE_FOLDER, DESTINATION_FOLDER
507+
);
508+
}
509+
510+
[NUnit.Framework.Test]
511+
public virtual void ImageStretchColumnFlexContainerTest() {
512+
ConvertToPdfAndCompare("imageStretchColumnFlexContainer", SOURCE_FOLDER, DESTINATION_FOLDER);
513+
}
514+
449515
private static IList<IElement> ConvertToElements(String name) {
450516
String sourceHtml = SOURCE_FOLDER + name + ".html";
451517
ConverterProperties converterProperties = new ConverterProperties().SetBaseUri(SOURCE_FOLDER);

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/DisplayTest.cs

+2
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 System.IO;
25+
using iText.Forms.Logs;
2526
using iText.Html2pdf;
2627
using iText.Html2pdf.Logs;
2728
using iText.Kernel.Geom;
@@ -128,6 +129,7 @@ public virtual void DisplayTable11Test() {
128129
[NUnit.Framework.Test]
129130
//TODO: update after DEVSIX-2445 fix
130131
[LogMessage(Html2PdfLogMessageConstant.NO_WORKER_FOUND_FOR_TAG, Count = 6)]
132+
[LogMessage(FormsLogMessageConstants.DUPLICATE_EXPORT_VALUE, Count = 2)]
131133
public virtual void DisplayBlockInsideParagraphTest() {
132134
ConvertToPdfAndCompare("displayBlockInsideParagraph", SOURCE_FOLDER, DESTINATION_FOLDER);
133135
}

0 commit comments

Comments
 (0)