Skip to content

Commit

Permalink
[RELEASE] iText pdfHTML 5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jul 20, 2023
2 parents 337c0e4 + 9732514 commit a50991c
Show file tree
Hide file tree
Showing 2,665 changed files with 58,617 additions and 332 deletions.
Binary file removed AppNet.class
Binary file not shown.
2 changes: 1 addition & 1 deletion doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "pdfHTML 5.0.0 API"
PROJECT_NAME = "pdfHTML 5.0.1 API"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.html2pdf.tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

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

[assembly: AssemblyVersion("5.0.0.0")]
[assembly: AssemblyFileVersion("5.0.0.0")]
[assembly: AssemblyInformationalVersion("5.0.0")]
[assembly: AssemblyVersion("5.0.1.0")]
[assembly: AssemblyFileVersion("5.0.1.0")]
[assembly: AssemblyInformationalVersion("5.0.1")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
8 changes: 4 additions & 4 deletions itext.tests/itext.html2pdf.tests/itext.html2pdf.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<PackageReference Include="itext7" Version="8.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<PackageReference Include="itext" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.layout\itext.layout.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.layout\itext.layout.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.forms\itext.forms.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.forms\itext.forms.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdfa\itext.pdfa.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdfa\itext.pdfa.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
<PackageReference Include="itext7.hyph" Version="8.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
<PackageReference Include="itext.hyph" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
<PackageReference Include="itext7.pdftest" Version="8.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
<PackageReference Include="itext.pdftest" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
<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')" />
<PackageReference Include="itext7.bouncy-castle-adapter" Version="8.0.0" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.1" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.styledxmlparser\itext.styledxmlparser.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.styledxmlparser\itext.styledxmlparser.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.svg\itext.svg.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.svg\itext.svg.csproj')" />
<ProjectReference Include="..\..\itext\itext.html2pdf\itext.html2pdf.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ You should have received a copy of the GNU Affero General Public License
using System;
using System.IO;
using iText.Forms;
using iText.Forms.Fields;
using iText.IO.Util;
using iText.Kernel.Pdf;
using iText.Kernel.Utils;
Expand Down Expand Up @@ -134,7 +135,7 @@ public virtual void ConvertToPdfAcroformFlattenAndCompare(String name, String so
System.Console.Out.WriteLine("html: " + UrlUtil.GetNormalizedFileUriString(sourceHtml) + "\n");
//flatted created tagged PDF with acroform
PdfDocument document = new PdfDocument(new PdfReader(outPdfPathAcro), new PdfWriter(outPdfPathFlatted));
PdfAcroForm acroForm = PdfAcroForm.GetAcroForm(document, false);
PdfAcroForm acroForm = PdfFormCreator.GetAcroForm(document, false);
acroForm.FlattenFields();
document.Close();
//compare with cmp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

using System;
using System.Threading;
using System.Threading.Tasks;
using iText.Commons;
using iText.IO.Source;
using iText.Test;
using Microsoft.Extensions.Logging;
using NUnit.Framework;
using ILogger = Microsoft.Extensions.Logging.ILogger;

namespace iText.Html2pdf {
[Category("IntegrationTest")]
public class HtmlConverterMultiThreadedTest : ExtendedITextTest
{
private static readonly ILogger LOGGER = ITextLogManager.GetLogger(typeof(iText.Html2pdf.HtmlConverterMultiThreadedTest
));

private static readonly String SOURCE_FOLDER =
TestUtil.GetParentProjectDirectory(TestContext.CurrentContext.TestDirectory) +
"/resources/itext/html2pdf/HtmlConverterMultiThreadedTest/";

[Test]
public void MultiThreadedHtmlToPdfConversionTest()
{
var runcount = 75;

//Set time limit of 2 seconds
var cts = new CancellationTokenSource();
cts.CancelAfter(2000 * 60);

var options = new ParallelOptions();
options.CancellationToken = cts.Token;
options.MaxDegreeOfParallelism = 100;

ThreadPool.SetMinThreads(runcount, runcount);

var results = new ParallelLoopResult();

try
{
results = Parallel.For(0, runcount, options, (i, state) =>
{
var outStr = new ByteArrayOutputStream();
HtmlConverter.ConvertToPdf(SOURCE_FOLDER + "basicHtml.html", outStr);
});
}
catch (OperationCanceledException e)
{
LOGGER.LogError("Thread timed out after 2 seconds.");
}
finally
{
cts.Dispose();
}

Assert.IsTrue(results.IsCompleted, "Not all tasks were successful.");
}
}
}
18 changes: 18 additions & 0 deletions itext.tests/itext.html2pdf.tests/itext/html2pdf/css/ClearTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,23 @@ public virtual void ImgWideBorderFloatAmongParaWithSpanTest() {
public virtual void ImgWideBorderClearAndDisplayBlockParaFloatTest() {
ConvertToPdfAndCompare("imgWideBorderClearAndDisplayBlockParaFloat", sourceFolder, destinationFolder);
}

[NUnit.Framework.Test]
public virtual void FloatsPositioningOutsideDivWithClearTest() {
// TODO DEVSIX-7602 Css right and left clear property is processed incorrectly if floats "intersect" by x
ConvertToPdfAndCompare("floatsPositioningOutsideDivWithClear", sourceFolder, destinationFolder);
}

[NUnit.Framework.Test]
public virtual void WideFloatsPositioningOutsideDivWithClearTest() {
// TODO DEVSIX-7602 Css right and left clear property is processed incorrectly for wide floats
ConvertToPdfAndCompare("wideFloatsPositioningOutsideDivWithClear", sourceFolder, destinationFolder);
}

[NUnit.Framework.Test]
public virtual void FloatsWithClearInsideFlexElementTest() {
// TODO DEVSIX-7602 Flex element width is incorrect in case clear property is applied to floats inside it
ConvertToPdfAndCompare("floatsWithClearInsideFlexElement", sourceFolder, destinationFolder);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
This file is part of the iText (R) project.
Copyright (c) 1998-2023 Apryse Group NV
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
using System;
using iText.Html2pdf;

namespace iText.Html2pdf.Css {
[NUnit.Framework.Category("IntegrationTest")]
public class ContinuousContainerTest : ExtendedHtmlConversionITextTest {
public static readonly String SOURCE_FOLDER = iText.Test.TestUtil.GetParentProjectDirectory(NUnit.Framework.TestContext
.CurrentContext.TestDirectory) + "/resources/itext/html2pdf/css/ContinuousContainerTest/";

public static readonly String DESTINATION_FOLDER = NUnit.Framework.TestContext.CurrentContext.TestDirectory
+ "/test/itext/html2pdf/css/ContinuousContainerTest/";

[NUnit.Framework.OneTimeSetUp]
public static void BeforeClass() {
CreateOrClearDestinationFolder(DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SimpleDivTest() {
RunTest("divTest");
}

[NUnit.Framework.Test]
public virtual void NestedDivTest() {
RunTest("nestedDivTest");
}

[NUnit.Framework.Test]
public virtual void ParagraphTest() {
RunTest("paragraphTest");
}

[NUnit.Framework.Test]
public virtual void TableTest() {
// TODO DEVSIX-7567 Support continuous container for tables (td)
RunTest("tableTest");
}

[NUnit.Framework.Test]
public virtual void ListTest() {
RunTest("listTest");
}

private void RunTest(String testName) {
ConvertToPdfAndCompare(testName, SOURCE_FOLDER, DESTINATION_FOLDER, false, new ConverterProperties().SetContinuousContainerEnabled
(true));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ You should have received a copy of the GNU Affero General Public License
using iText.Forms.Form.Element;
using iText.Html2pdf;
using iText.Html2pdf.Attach.Impl.Layout;
using iText.Html2pdf.Logs;
using iText.Layout.Element;
using iText.Layout.Properties;
using iText.Layout.Renderer;
Expand Down Expand Up @@ -162,9 +161,7 @@ public virtual void BrTagTest() {
}

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

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

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest1() {
ConvertToPdfAndCompare("wrappedFlexStretchSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest2() {
ConvertToPdfAndCompare("wrappedFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest3() {
ConvertToPdfAndCompare("wrappedFlexEndSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest4() {
ConvertToPdfAndCompare("wrappedFlexCenterSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest5() {
ConvertToPdfAndCompare("wrappedReverseFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest6() {
ConvertToPdfAndCompare("wrappedReverseFlexEndSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest7() {
ConvertToPdfAndCompare("wrappedRowReverseFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void SplitWrappedFlexContainersTest8() {
ConvertToPdfAndCompare("wrappedRowReverseFlexEndSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
[LogMessage(iText.IO.Logs.IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, Ignore = true)]
public virtual void SplitWrappedFlexContainersTest9() {
ConvertToPdfAndCompare("wrappedRowReverseRtlFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
[LogMessage(iText.IO.Logs.IoLogMessageConstant.TYPOGRAPHY_NOT_FOUND, Ignore = true)]
public virtual void SplitWrappedFlexContainersTest10() {
ConvertToPdfAndCompare("wrappedRowRtlFlexStartSplit", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void EndlessColumnFlexContainerWithPercentFlexBasisTest() {
ConvertToPdfAndCompare("endlessColumnFlexContainerWithPercentFlexBasis", SOURCE_FOLDER, DESTINATION_FOLDER
);
}

[NUnit.Framework.Test]
public virtual void DefiniteMainSizeColumnFlexContainerWithPercentFlexBasisTest() {
ConvertToPdfAndCompare("definiteMainSizeColumnFlexContainerWithPercentFlexBasis", SOURCE_FOLDER, DESTINATION_FOLDER
);
}

[NUnit.Framework.Test]
public virtual void ImageStretchColumnFlexContainerTest() {
ConvertToPdfAndCompare("imageStretchColumnFlexContainer", SOURCE_FOLDER, DESTINATION_FOLDER);
}

private static IList<IElement> ConvertToElements(String name) {
String sourceHtml = SOURCE_FOLDER + name + ".html";
ConverterProperties converterProperties = new ConverterProperties().SetBaseUri(SOURCE_FOLDER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You should have received a copy of the GNU Affero General Public License
*/
using System;
using System.IO;
using iText.Forms.Logs;
using iText.Html2pdf;
using iText.Html2pdf.Logs;
using iText.Kernel.Geom;
Expand Down Expand Up @@ -128,6 +129,7 @@ public virtual void DisplayTable11Test() {
[NUnit.Framework.Test]
//TODO: update after DEVSIX-2445 fix
[LogMessage(Html2PdfLogMessageConstant.NO_WORKER_FOUND_FOR_TAG, Count = 6)]
[LogMessage(FormsLogMessageConstants.DUPLICATE_EXPORT_VALUE, Count = 2)]
public virtual void DisplayBlockInsideParagraphTest() {
ConvertToPdfAndCompare("displayBlockInsideParagraph", SOURCE_FOLDER, DESTINATION_FOLDER);
}
Expand Down
Loading

0 comments on commit a50991c

Please sign in to comment.