Skip to content

Commit ea6caec

Browse files
ars18wrwiText-CI
authored andcommitted
Minor refactoring: move some tests which do not use private resources to a public html2pdf repository.
DEVSIX-2429 DEVSIX-2384
1 parent 0908af2 commit ea6caec

File tree

9 files changed

+96
-0
lines changed

9 files changed

+96
-0
lines changed

src/test/java/com/itextpdf/html2pdf/element/ImageTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,30 @@ public void imagesInBodyTest() throws IOException, InterruptedException {
7272
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "imagesInBody.pdf", sourceFolder + "cmp_imagesInBody.pdf", destinationFolder, "diff18_"));
7373
}
7474

75+
@Test
76+
public void imagesWithWideBorders() throws IOException, InterruptedException {
77+
HtmlConverter.convertToPdf(new File(sourceFolder + "imagesWithWideBorders.html"), new File(destinationFolder + "imagesWithWideBorders.pdf"));
78+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "imagesWithWideBorders.pdf", sourceFolder + "cmp_imagesWithWideBorders.pdf", destinationFolder));
79+
}
80+
81+
@Test
82+
public void imagesWithWideMargins() throws IOException, InterruptedException {
83+
HtmlConverter.convertToPdf(new File(sourceFolder + "imagesWithWideMargins.html"), new File(destinationFolder + "imagesWithWideMargins.pdf"));
84+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "imagesWithWideMargins.pdf", sourceFolder + "cmp_imagesWithWideMargins.pdf", destinationFolder));
85+
}
86+
87+
@Test
88+
// TODO DEVSIX-2467
89+
public void imagesWithWidePaddings() throws IOException, InterruptedException {
90+
HtmlConverter.convertToPdf(new File(sourceFolder + "imagesWithWidePaddings.html"), new File(destinationFolder + "imagesWithWidePaddings.pdf"));
91+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "imagesWithWidePaddings.pdf", sourceFolder + "cmp_imagesWithWidePaddings.pdf", destinationFolder));
92+
}
93+
94+
@Test
95+
// TODO DEVSIX-2467
96+
public void imagesWithWidePaddingsBordersMargins() throws IOException, InterruptedException {
97+
HtmlConverter.convertToPdf(new File(sourceFolder + "imagesWithWidePaddingsBordersMargins.html"), new File(destinationFolder + "imagesWithWidePaddingsBordersMargins.pdf"));
98+
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "imagesWithWidePaddingsBordersMargins.pdf", sourceFolder + "cmp_imagesWithWidePaddingsBordersMargins.pdf", destinationFolder));
99+
}
100+
75101
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html>
2+
<head>
3+
<style>
4+
img {
5+
border: 30pt solid black;
6+
}
7+
</style>
8+
</head>
9+
<body>
10+
<img src="100x100placeholder.png">
11+
<img src="100x100placeholder.png">
12+
<img src="100x100placeholder.png">
13+
<img src="100x100placeholder.png">
14+
<img src="100x100placeholder.png">
15+
<img src="100x100placeholder.png">
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html>
2+
<head>
3+
<style>
4+
img {
5+
margin: 30pt;
6+
}
7+
</style>
8+
</head>
9+
<body>
10+
<img src="100x100placeholder.png">
11+
<img src="100x100placeholder.png">
12+
<img src="100x100placeholder.png">
13+
<img src="100x100placeholder.png">
14+
<img src="100x100placeholder.png">
15+
<img src="100x100placeholder.png">
16+
</body>
17+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html>
2+
<head>
3+
<style>
4+
img {
5+
padding: 30pt;
6+
}
7+
</style>
8+
</head>
9+
<body>
10+
<img src="100x100placeholder.png">
11+
<img src="100x100placeholder.png">
12+
<img src="100x100placeholder.png">
13+
<img src="100x100placeholder.png">
14+
<img src="100x100placeholder.png">
15+
<img src="100x100placeholder.png">
16+
</body>
17+
</html>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<html>
2+
<head>
3+
<style>
4+
img {
5+
padding: 15pt;
6+
border: 15pt solid black;
7+
margin: 15pt;
8+
}
9+
</style>
10+
</head>
11+
<body>
12+
<img src="100x100placeholder.png">
13+
<img src="100x100placeholder.png">
14+
<img src="100x100placeholder.png">
15+
<img src="100x100placeholder.png">
16+
<img src="100x100placeholder.png">
17+
<img src="100x100placeholder.png">
18+
</body>
19+
</html>

0 commit comments

Comments
 (0)