Skip to content

Commit

Permalink
[RELEASE] iText pdfHtml 5.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jul 12, 2024
2 parents 21ea8f9 + 418b88a commit a793fa9
Show file tree
Hide file tree
Showing 1,365 changed files with 28,227 additions and 238 deletions.
4 changes: 2 additions & 2 deletions 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.4 API"
PROJECT_NAME = "pdfHTML 5.0.5 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 Expand Up @@ -485,7 +485,7 @@ EXTRACT_PRIV_VIRTUAL = NO
# scope will be included in the documentation.
# The default value is: NO.

EXTRACT_PACKAGE = NO
EXTRACT_PACKAGE = YES

# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
# included in the documentation.
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.4.0")]
[assembly: AssemblyFileVersion("5.0.4.0")]
[assembly: AssemblyInformationalVersion("5.0.4")]
[assembly: AssemblyVersion("5.0.5.0")]
[assembly: AssemblyFileVersion("5.0.5.0")]
[assembly: AssemblyInformationalVersion("5.0.5")]

#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 @@ -44,17 +44,17 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<PackageReference Include="itext" Version="8.0.4" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.csproj')" />
<PackageReference Include="itext" Version="8.0.5" 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="itext.hyph" Version="8.0.4" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.csproj')" />
<PackageReference Include="itext.hyph" Version="8.0.5" 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="itext.pdftest" Version="8.0.4" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.csproj')" />
<PackageReference Include="itext.pdftest" Version="8.0.5" 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="itext.bouncy-castle-adapter" Version="8.0.4" Condition="!Exists('..\..\..\itextcore\itext\itext.bouncy-castle-adapter\itext.bouncy-castle-adapter.csproj')" />
<PackageReference Include="itext.bouncy-castle-adapter" Version="8.0.5" 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 @@ -40,7 +40,7 @@ namespace iText.Html2pdf {
public class HtmlConverterMetaInfoTest : ExtendedITextTest {
[NUnit.Framework.Test]
public virtual void MetaInfoShouldBePresentTest() {
IMetaInfo o = new _IMetaInfo_56();
IMetaInfo o = new _IMetaInfo_55();
ConverterProperties converterProperties = new ConverterProperties();
converterProperties.SetEventMetaInfo(o);
HtmlConverterMetaInfoTest.InvocationAssert invocationAssert = new HtmlConverterMetaInfoTest.InvocationAssert
Expand All @@ -54,8 +54,8 @@ public virtual void MetaInfoShouldBePresentTest() {
NUnit.Framework.Assert.IsTrue(invocationAssert.IsInvoked());
}

private sealed class _IMetaInfo_56 : IMetaInfo {
public _IMetaInfo_56() {
private sealed class _IMetaInfo_55 : IMetaInfo {
public _IMetaInfo_55() {
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,23 @@ You should have received a copy of the GNU Affero General Public License
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using iText.Commons.Utils;
using iText.Kernel.Pdf;

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

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

private readonly String htmlName;

private readonly String testName;

private readonly PdfAConformanceLevel conformanceLevel;

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

public HtmlConverterPdfAParameterizedTest(Object htmlName, Object testName, Object conformance) {
this.conformanceLevel = (PdfAConformanceLevel)conformance;
this.htmlName = (String)htmlName;
this.testName = (String)testName;
}

public HtmlConverterPdfAParameterizedTest(Object[] array)
: this(array[0], array[1], array[2]) {
}

// TODO DEVSIX-2449 z-index is not supported (zindex.html)
public static IEnumerable<Object[]> RotationRelatedProperties() {
return JavaUtil.ArraysAsList(new Object[][] { new Object[] { "images.html", "pdfA4BasicImageTest", PdfAConformanceLevel
Expand Down Expand Up @@ -105,12 +87,9 @@ public static IEnumerable<Object[]> RotationRelatedProperties() {
}, new Object[] { "zIndex.html", "pdfA1ZIndexTest", PdfAConformanceLevel.PDF_A_1B } });
}

public static ICollection<NUnit.Framework.TestFixtureData> RotationRelatedPropertiesTestFixtureData() {
return RotationRelatedProperties().Select(array => new NUnit.Framework.TestFixtureData(array)).ToList();
}

[NUnit.Framework.Test]
public virtual void ConvertToPdfA4Test() {
[NUnit.Framework.TestCaseSource("RotationRelatedProperties")]
public virtual void ConvertToPdfA4Test(Object htmlName, Object testName, PdfAConformanceLevel conformanceLevel
) {
String sourceHtml = SOURCE_FOLDER + htmlName;
String destinationPdf = DESTINATION_FOLDER + testName + ".pdf";
String cmpPdf = SOURCE_FOLDER + "cmp_" + testName + ".pdf";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ public virtual void ConvertToPdfASimpleTest() {

[NUnit.Framework.Test]
public virtual void CannotConvertHtmlToDocumentInReadingModeTest() {
NUnit.Framework.Assert.That(() => {
Exception exception = NUnit.Framework.Assert.Catch(typeof(Html2PdfException), () => {
PdfDocument pdfDocument = CreateTempDoc();
ConverterProperties properties = new ConverterProperties();
Document document = HtmlConverter.ConvertToDocument("", pdfDocument, properties);
}
, NUnit.Framework.Throws.InstanceOf<Html2PdfException>().With.Message.EqualTo(Html2PdfException.PDF_DOCUMENT_SHOULD_BE_IN_WRITING_MODE))
;
);
NUnit.Framework.Assert.AreEqual(Html2PdfException.PDF_DOCUMENT_SHOULD_BE_IN_WRITING_MODE, exception.Message
);
}

[NUnit.Framework.Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public static void BeforeClass() {

[NUnit.Framework.Test]
public virtual void DoNotResetFontProviderTest() {
NUnit.Framework.Assert.That(() => {
NUnit.Framework.Assert.Catch(typeof(PdfException), () => {
FileStream fileInputStream = new FileStream(sourceFolder + "justHelloWorld.html", FileMode.Open, FileAccess.Read
);
IXmlParser parser = new JsoupHtmlParser();
IDocumentNode documentNode = parser.Parse(fileInputStream, null);
ConverterProperties converterProperties = new ConverterProperties();
converterProperties.SetFontProvider(new _DefaultFontProvider_71(false, true, false));
converterProperties.SetFontProvider(new _DefaultFontProvider_66(false, true, false));
// Do nothing here. That should result in an exception.
IHtmlProcessor processor = new DefaultHtmlProcessor(converterProperties);
Document doc1 = processor.ProcessDocument(documentNode, new PdfDocument(new PdfWriter(new MemoryStream()))
Expand All @@ -67,12 +67,11 @@ public virtual void DoNotResetFontProviderTest() {
NUnit.Framework.Assert.IsTrue(false, "The test should have failed before that assert, since it's strictly forbidden not to reset the FontProvider instance after each html to pdf conversion."
);
}
, NUnit.Framework.Throws.InstanceOf<PdfException>())
;
);
}

private sealed class _DefaultFontProvider_71 : DefaultFontProvider {
public _DefaultFontProvider_71(bool baseArg1, bool baseArg2, bool baseArg3)
private sealed class _DefaultFontProvider_66 : DefaultFontProvider {
public _DefaultFontProvider_66(bool baseArg1, bool baseArg2, bool baseArg3)
: base(baseArg1, baseArg2, baseArg3) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ public virtual void CannotGetTagWorkerForCustomTagViaReflection() {
}
}

//\cond DO_NOT_DOCUMENT
internal class TestTagWorkerFactory : DefaultTagWorkerFactory {
public TestTagWorkerFactory() {
GetDefaultMapping().PutMapping("custom-tag", (lhs, rhs) => new TestClass());
}
}
//\endcond

//\cond DO_NOT_DOCUMENT
internal class TestClass : ITagWorker {
public virtual void ProcessEnd(IElementNode element, ProcessorContext context) {
}
Expand All @@ -62,4 +65,5 @@ public virtual IPropertyContainer GetElementResult() {
return null;
}
}
//\endcond
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public class PageCountRendererTest : ExtendedITextTest {
[NUnit.Framework.Test]
[LogMessage(iText.IO.Logs.IoLogMessageConstant.GET_NEXT_RENDERER_SHOULD_BE_OVERRIDDEN)]
public virtual void GetNextRendererShouldBeOverriddenTest() {
PageCountRenderer pageCountRenderer = new _PageCountRenderer_50(new PageCountElement());
PageCountRenderer pageCountRenderer = new _PageCountRenderer_49(new PageCountElement());
// Nothing is overridden
NUnit.Framework.Assert.AreEqual(typeof(PageCountRenderer), pageCountRenderer.GetNextRenderer().GetType());
}

private sealed class _PageCountRenderer_50 : PageCountRenderer {
public _PageCountRenderer_50(PageCountElement baseArg1)
private sealed class _PageCountRenderer_49 : PageCountRenderer {
public _PageCountRenderer_49(PageCountElement baseArg1)
: base(baseArg1) {
}
}
Expand All @@ -55,6 +55,7 @@ public virtual void CreateCopyShouldBeOverriddenTest() {
NUnit.Framework.Assert.IsTrue(true);
}

//\cond DO_NOT_DOCUMENT
internal class CustomPageCountRenderer : PageCountRenderer {
public CustomPageCountRenderer(PageCountElement textElement)
: base(textElement) {
Expand All @@ -74,5 +75,6 @@ public override IRenderer GetNextRenderer() {
return new PageCountRendererTest.CustomPageCountRenderer((PageCountElement)this.modelElement);
}
}
//\endcond
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public class PageTargetCountRendererTest : ExtendedITextTest {
[NUnit.Framework.Test]
[LogMessage(iText.IO.Logs.IoLogMessageConstant.GET_NEXT_RENDERER_SHOULD_BE_OVERRIDDEN)]
public virtual void GetNextRendererShouldBeOverriddenTest() {
PageTargetCountRenderer pageTargetCountRenderer = new _PageTargetCountRenderer_51(new PageTargetCountElement
PageTargetCountRenderer pageTargetCountRenderer = new _PageTargetCountRenderer_50(new PageTargetCountElement
("test"));
// Nothing is overridden
NUnit.Framework.Assert.AreEqual(typeof(PageTargetCountRenderer), pageTargetCountRenderer.GetNextRenderer()
.GetType());
}

private sealed class _PageTargetCountRenderer_51 : PageTargetCountRenderer {
public _PageTargetCountRenderer_51(PageTargetCountElement baseArg1)
private sealed class _PageTargetCountRenderer_50 : PageTargetCountRenderer {
public _PageTargetCountRenderer_50(PageTargetCountElement baseArg1)
: base(baseArg1) {
}
}
Expand All @@ -57,6 +57,7 @@ public virtual void CreateCopyShouldBeOverriddenTest() {
NUnit.Framework.Assert.IsTrue(true);
}

//\cond DO_NOT_DOCUMENT
internal class CustomPageTargetCountRenderer : PageTargetCountRenderer {
public CustomPageTargetCountRenderer(PageTargetCountElement textElement)
: base(textElement) {
Expand All @@ -77,5 +78,6 @@ public override IRenderer GetNextRenderer() {
);
}
}
//\endcond
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ public virtual void MinFixContentDimensionTest() {
INode iNode = null;
IDictionary<String, String> styles = new Dictionary<String, String>();
styles.Put("width", "20pt");
CssContextNode cssContextNode = new _CssContextNode_46(iNode);
CssContextNode cssContextNode = new _CssContextNode_45(iNode);
cssContextNode.SetStyles(styles);
Paragraph paragraph = new Paragraph("Paragraph");
WidthDimensionContainer widthDimensionContainer = new WidthDimensionContainer(cssContextNode, 500, paragraph
.CreateRendererSubTree(), 0);
NUnit.Framework.Assert.AreEqual(widthDimensionContainer.minContentDimension, 20, 0.0);
}

private sealed class _CssContextNode_46 : CssContextNode {
public _CssContextNode_46(INode baseArg1)
private sealed class _CssContextNode_45 : CssContextNode {
public _CssContextNode_45(INode baseArg1)
: base(baseArg1) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ public virtual void UnusedFontWithUnicodeRangeTest() {
RunTest("unusedFontWithUnicodeRangeTest");
}

[NUnit.Framework.Test]
public virtual void BolderAndLighterFontWeightTest() {
//TODO DEVSIX-2114: Support bolder / Lighter font weight
RunTest("bolderLighterFontWeightTest");
}

private void RunTest(String name, FontProvider fontProvider) {
String htmlPath = sourceFolder + name + ".html";
String pdfPath = destinationFolder + name + ".pdf";
Expand Down
Loading

0 comments on commit a793fa9

Please sign in to comment.