Skip to content

Commit 9557acd

Browse files
yulian-gaponenkopavel-alay
authored andcommitted
Add tests with image content in margin boxes
DEVSIX-1050 Autoported commit. Original commit hash: [976cfb36]
1 parent fda3fa2 commit 9557acd

File tree

7 files changed

+65
-1
lines changed

7 files changed

+65
-1
lines changed

itext.tests/itext.html2pdf.tests/itext/html2pdf/css/PageRuleTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,20 @@ public virtual void MarginBoxTest04() {
190190
RunTest("marginBoxTest04");
191191
}
192192

193+
/// <exception cref="System.IO.IOException"/>
194+
/// <exception cref="System.Exception"/>
195+
[NUnit.Framework.Test]
196+
public virtual void MarginBoxTestImg01() {
197+
RunTest("marginBoxTestImg01");
198+
}
199+
200+
/// <exception cref="System.IO.IOException"/>
201+
/// <exception cref="System.Exception"/>
202+
[NUnit.Framework.Test]
203+
public virtual void MarginBoxTestImg02() {
204+
RunTest("marginBoxTestImg02");
205+
}
206+
193207
/// <exception cref="System.IO.IOException"/>
194208
/// <exception cref="System.Exception"/>
195209
[NUnit.Framework.Test]
23.5 KB
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style type="text/css">
5+
@page {
6+
margin: 2in 1in 1in 1in;
7+
@top-left {
8+
border: lightgray 2px solid;
9+
overflow: visible;
10+
content: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlID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UxvCbg2nkpRjBXX0Tt0oZzLHQ6jctM9tKCqihru2BrbTNWkAJI3n1BgH1PyHcsNXmV/LiKS5WyYskBjhKsYcTyohaxb3MhqZ8vAUYAP8OKf0qLt2tAAAAAElFTkSuQmCC');
11+
}
12+
@top-right {
13+
border: green 2px solid;
14+
overflow: visible;
15+
content: "Some text that is long enough. 'Before you discuss the resolution, let me place before you one or two things, I want you to understand two things very clearly and to consider them from the same point of view from which I am placing them before you. I ask you to consider it from my point of view, because if you approve of it, you will be enjoined to carry out all I say. It will be a great responsibility. There are people who ask me whether I am the same man that I was in 1920, or whether there has been any change in me. You are right in asking that question.'";
16+
}
17+
}
18+
</style>
19+
</head>
20+
<body>
21+
<div style="background-color: yellow;">
22+
Arbitrary text.
23+
</div>
24+
</body>
25+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style type="text/css">
5+
@page {
6+
margin: 2in 1in 1in 1in;
7+
@top-left {
8+
border: red 2px solid;
9+
overflow: visible;
10+
content: url('itisSmall.jpg');
11+
}
12+
@top-right {
13+
border: green 2px solid;
14+
overflow: visible;
15+
content: "A few text here. Not really a lot, but still reasonable a little. A few text here. Not really a lot, but still reasonable a little.";
16+
}
17+
}
18+
</style>
19+
</head>
20+
<body>
21+
<div style="background-color: yellow;">
22+
Arbitrary text.
23+
</div>
24+
</body>
25+
</html>

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
63adb0d104711567b2815745f6491c19b0236bb2
1+
976cfb3668b5f67f3bab4467a894812ab59d630f

0 commit comments

Comments
 (0)