Skip to content

Commit cd796b9

Browse files
Add new test for handling SVG in <object> tag with inner resources
DEVSIX-2338 Autoported commit. Original commit hash: [d166e48247]
1 parent bc77af2 commit cd796b9

File tree

6 files changed

+28
-1
lines changed

6 files changed

+28
-1
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/element/SvgTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@ public virtual void ExternalObjectSuccessTest() {
145145
+ "cmp_" + name + ".pdf", destinationFolder, "diff_" + name + "_"));
146146
}
147147

148+
/// <exception cref="System.IO.IOException"/>
149+
/// <exception cref="System.Exception"/>
150+
[NUnit.Framework.Test]
151+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.ERROR_RESOLVING_PARENT_STYLES, Count = 4)]
152+
[LogMessage(iText.StyledXmlParser.LogMessageConstant.UNABLE_TO_RETRIEVE_IMAGE_WITH_GIVEN_BASE_URI, Count =
153+
1)]
154+
public virtual void ExternalObjectWithResourceTest() {
155+
// TODO DEVSIX-2338: image inside the SVG cannot be resolved because baseUri is not passed correctly in ObjectTagWorker: processUtil.createImageFromProcessingResult(res,document)
156+
String name = "external_object_with_resource";
157+
HtmlConverter.ConvertToPdf(new FileInfo(sourceFolder + name + ".html"), new FileInfo(destinationFolder + name
158+
+ ".pdf"));
159+
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(destinationFolder + name + ".pdf", sourceFolder
160+
+ "cmp_" + name + ".pdf", destinationFolder, "diff_" + name + "_"));
161+
}
162+
148163
/// <exception cref="System.IO.IOException"/>
149164
/// <exception cref="System.Exception"/>
150165
[NUnit.Framework.Test]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<object data="resources/imageWithMultipleShapes.svg" type="image/svg+xml"></object>
5+
</body>
6+
</html>
3.75 KB
Loading
Lines changed: 6 additions & 0 deletions
Loading

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
635d7abc3812b211d8d1f46af80c61e6f7a6f9ba
1+
d166e48247391a0fc6b6144c5de47ab289ac2a68

0 commit comments

Comments
 (0)