Skip to content

Commit

Permalink
[RELEASE] iText 7 pdfHTML 4.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
iText-CI committed Jun 20, 2022
2 parents 2920093 + f591e04 commit 5f92da6
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 22 deletions.
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 4.0.2 API"
PROJECT_NAME = "pdfHTML 4.0.3 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("4.0.2.0")]
[assembly: AssemblyFileVersion("4.0.2.0")]
[assembly: AssemblyInformationalVersion("4.0.2")]
[assembly: AssemblyVersion("4.0.3.0")]
[assembly: AssemblyFileVersion("4.0.3.0")]
[assembly: AssemblyInformationalVersion("4.0.3")]

#if !NETSTANDARD2_0
[assembly: NUnit.Framework.Timeout(300000)]
Expand Down
6 changes: 3 additions & 3 deletions itext.tests/itext.html2pdf.tests/itext.html2pdf.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<PackageReference Include="itext7" Version="7.2.2" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<PackageReference Include="itext7" Version="7.2.3" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.layout\itext.layout.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.layout\itext.layout.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.forms\itext.forms.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.forms\itext.forms.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdfa\itext.pdfa.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdfa\itext.pdfa.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.hyph\itext.hyph.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.netstandard.csproj')" />
<PackageReference Include="itext7.hyph" Version="7.2.2" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.netstandard.csproj')" />
<PackageReference Include="itext7.hyph" Version="7.2.3" Condition="!Exists('..\..\..\itextcore\itext\itext.hyph\itext.hyph.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj')" />
<PackageReference Include="itext7.pdftest" Version="7.2.2" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj')" />
<PackageReference Include="itext7.pdftest" Version="7.2.3" Condition="!Exists('..\..\..\itextcore\itext\itext.pdftest\itext.pdftest.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.styledxmlparser\itext.styledxmlparser.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.styledxmlparser\itext.styledxmlparser.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.svg\itext.svg.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.svg\itext.svg.netstandard.csproj')" />
<ProjectReference Include="..\..\itext\itext.html2pdf\itext.html2pdf.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ public virtual void MarginsCollapseInsideFlexItemTest() {
ConvertToPdfAndCompare("marginsCollapseInsideFlexItem", SOURCE_FOLDER, DESTINATION_FOLDER);
}

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

private static void AssertDiv(IElement element, String text) {
NUnit.Framework.Assert.IsTrue(element is Div);
NUnit.Framework.Assert.AreEqual(1, ((Div)element).GetChildren().Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,8 @@ public virtual void ResponsiveIText() {
foreach (PageSize pageSize in pageSizes) {
float? pxWidth = null;
if (pageSize != null) {
pxWidth = CssDimensionParsingUtils.ParseAbsoluteLength(pageSize.GetWidth().ToString());
pxWidth = CssDimensionParsingUtils.ParseAbsoluteLength(pageSize.GetWidth().ToString(System.Globalization.CultureInfo.InvariantCulture
));
}
String outName = "responsiveIText" + (pxWidth != null ? "_" + (int)(float)pxWidth : "") + ".pdf";
PdfWriter writer = new PdfWriter(DESTINATION_FOLDER + outName);
Expand All @@ -731,7 +732,8 @@ public virtual void ResponsiveIText() {
foreach (PageSize pageSize in pageSizes) {
float? pxWidth = null;
if (pageSize != null) {
pxWidth = CssDimensionParsingUtils.ParseAbsoluteLength(pageSize.GetWidth().ToString());
pxWidth = CssDimensionParsingUtils.ParseAbsoluteLength(pageSize.GetWidth().ToString(System.Globalization.CultureInfo.InvariantCulture
));
}
String outName = "responsiveIText" + (pxWidth != null ? "_" + (int)(float)pxWidth : "") + ".pdf";
String cmpName = "cmp_" + outName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public virtual void MarginAutoImageInsideDiv02Test() {
ConvertToPdfAndCompare("marginAutoImageInsideDiv02", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
public virtual void AutoMarginTest() {
//TODO DEVSIX-5002 pdfHTML: support 'margin: auto'
ConvertToPdfAndCompare("autoMargin", SOURCE_FOLDER, DESTINATION_FOLDER);
}

[NUnit.Framework.Test]
//TODO DEVSIX-1101 Layout + Html2pdf: Support margin value in percents
[LogMessage(Html2PdfLogMessageConstant.MARGIN_VALUE_IN_PERCENT_NOT_SUPPORTED)]
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
*[parent]:not([parent~="z"]) {
display: flex;
}
*[child1]:not([child1~="z"]) {
display: none;
}
*[child2]:not([child2~="z"]) {
display: block;
}
</style>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="fieldLabel" parent="v"> FlexParent
<div class="fieldLabe2" child1="w"> , NoneChild </div>
<div class="fieldLabe2" child2="x"> , BlockChild </div>
</div>
<div class="fieldLabe3"> NoneChild should be unvisible </div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div style="background-color: blue; position: absolute">
<div style="background-color: yellow; width: 100px; margin-left: auto">
should aligned right cause of margins<br/>
</div>
<div style="background-color: yellow; width: 200px">
should aligned left as default
</div>
</div>
</body>
</html>
Binary file not shown.
6 changes: 3 additions & 3 deletions itext/itext.html2pdf/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@

[assembly: Guid("ff6ba09d-3655-466a-8c17-a7bfd3479ca1")]

[assembly: AssemblyVersion("4.0.2.0")]
[assembly: AssemblyFileVersion("4.0.2.0")]
[assembly: AssemblyInformationalVersion("4.0.2")]
[assembly: AssemblyVersion("4.0.3.0")]
[assembly: AssemblyFileVersion("4.0.3.0")]
[assembly: AssemblyInformationalVersion("4.0.3")]
2 changes: 1 addition & 1 deletion itext/itext.html2pdf/itext.html2pdf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<PackageReference Include="itext7" Version="7.2.2" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<PackageReference Include="itext7" Version="7.2.3" Condition="!Exists('..\..\..\itextcore\itext\itext.io\itext.io.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.kernel\itext.kernel.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.kernel\itext.kernel.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.layout\itext.layout.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.layout\itext.layout.netstandard.csproj')" />
<ProjectReference Include="..\..\..\itextcore\itext\itext.forms\itext.forms.netstandard.csproj" Condition="Exists('..\..\..\itextcore\itext\itext.forms\itext.forms.netstandard.csproj')" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace iText.Html2pdf.Actions.Data {
public sealed class PdfHtmlProductData {
private const String PDF_HTML_PUBLIC_PRODUCT_NAME = "pdfHTML";

private const String PDF_HTML_VERSION = "4.0.2";
private const String PDF_HTML_VERSION = "4.0.3";

private const int PDF_HTML_COPYRIGHT_SINCE = 2000;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public virtual void Apply(ProcessorContext context, IStylesContainer stylesConta
}
}
}
// TODO as for now spans are flattened, let's at least make kids of floating spans floating too
String floatVal = cssStyles.Get(CssConstants.FLOAT);
if (floatVal != null && !CssConstants.NONE.Equals(floatVal)) {
foreach (IPropertyContainer elem in spanTagWorker.GetAllElements()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ internal static IList<INode> ResolveContent(IDictionary<String, String> styles,
if (token.GetValue().StartsWith("url(")) {
IDictionary<String, String> attributes = new Dictionary<String, String>();
attributes.Put(AttributeConstants.SRC, CssUtils.ExtractUrl(token.GetValue()));
//TODO: probably should add user agent styles on CssContentElementNode creation, not here.
attributes.Put(AttributeConstants.STYLE, CssConstants.DISPLAY + ":" + CssConstants.INLINE_BLOCK);
result.Add(new CssContentElementNode(contentContainer, TagConstants.IMG, attributes));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ private IDictionary<String, String> ResolveStyles(INode element, CssContext cont
elementStyles = StyleUtil.MergeParentStyleDeclaration(elementStyles, entry.Key, entry.Value, parentStyles.
Get(CommonCssConstants.FONT_SIZE), inheritanceRules);
// If the parent has display: flex, the flex item is blockified
// no matter what display value is set for it.
// no matter what display value is set for it (except 'none' value).
// See CSS Flexible Box Layout Module Level 1,
// W3C Candidate Recommendation, 19 November 2018: 4. Flex Items.
if (IsFlexItem(entry, elementStyles.Get(CssConstants.DISPLAY))) {
String currentElementDisplay = elementStyles.Get(CssConstants.DISPLAY);
if (IsFlexItem(entry, currentElementDisplay) && !CommonCssConstants.NONE.Equals(currentElementDisplay)) {
elementStyles.Put(CssConstants.DISPLAY, CssConstants.BLOCK);
}
}
Expand Down
6 changes: 3 additions & 3 deletions pdfHTML.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>itext7.pdfhtml</id>
<version>4.0.2</version>
<version>4.0.3</version>
<title>iText 7 pdfHTML</title>
<authors>iText Software</authors>
<owners>iText Software</owners>
Expand All @@ -19,10 +19,10 @@
<repository type="git" url="https://github.com/itext/i7n-pdfhtml.git" />
<dependencies>
<group targetFramework="net461">
<dependency id="itext7" version="7.2.2" />
<dependency id="itext7" version="7.2.3" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="itext7" version="7.2.2" />
<dependency id="itext7" version="7.2.3" />
</group>
</dependencies>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion port-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12343b9837284da254c583d7e8ea63aeea5c4624
dabd0f95b6ce55524fa71022ff05eef9ad1f4aa9

0 comments on commit 5f92da6

Please sign in to comment.