Skip to content

Commit a9bca9c

Browse files
SnipxiText-CI
authored andcommitted
Add new test demonstratic incorrect total page count when last page is trimmed
DEVSIX-5509
1 parent 65c57ae commit a9bca9c

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

src/test/java/com/itextpdf/html2pdf/attach/impl/layout/PageCountRendererTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ This file is part of the iText (R) project.
2222
*/
2323
package com.itextpdf.html2pdf.attach.impl.layout;
2424

25-
import com.itextpdf.html2pdf.attach.impl.layout.PageTargetCountRendererTest.CustomPageTargetCountRenderer;
2625
import com.itextpdf.io.LogMessageConstant;
2726
import com.itextpdf.io.font.otf.Glyph;
2827
import com.itextpdf.io.font.otf.GlyphLine;

src/test/java/com/itextpdf/html2pdf/css/CounterTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,10 @@ public void pageCounter04Test() throws IOException, InterruptedException {
9090
public void pageCounterSpacesInDeclarationTest() throws IOException, InterruptedException {
9191
convertToPdfAndCompare("page_counter_spaces_in_declaration", sourceFolder, destinationFolder);
9292
}
93+
94+
@Test
95+
// TODO fix cmp after DEVSIX-5509 is done; currently total page count is incorrect
96+
public void pageCounterWithTrimmedLastPageTest() throws IOException, InterruptedException {
97+
convertToPdfAndCompare("page_counter_with_trimmed_last_page", sourceFolder, destinationFolder);
98+
}
9399
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<html>
2+
<head>
3+
<style>
4+
@page {
5+
@top-left {
6+
content: "Page " counter(page) " / " counter(pages);
7+
}
8+
}</style>
9+
</head>
10+
11+
<body>
12+
<div><span>Text on first page</span></div>
13+
<div style="page-break-after:always"></div>
14+
<div></div>
15+
</body>
16+
</html>

0 commit comments

Comments
 (0)