Skip to content

Commit 27ada38

Browse files
author
Andrei Stryhelski
committed
Check heading structure, add paragraphsInHeadingsTest
DEVSIX-8476
1 parent 56c2d2a commit 27ada38

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

src/test/java/com/itextpdf/html2pdf/HtmlConverterPdfUA1UA2Test.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,18 @@ public void headingInButtonTest() throws IOException, InterruptedException {
186186
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
187187
}
188188

189+
@Test
190+
public void paragraphsInHeadingsTest() throws IOException, InterruptedException {
191+
String sourceHtml = SOURCE_FOLDER + "paragraphsInHeadings.html";
192+
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_paragraphsInHeadingsUa1.pdf";
193+
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_paragraphsInHeadingsUa2.pdf";
194+
String destinationPdfUa1 = DESTINATION_FOLDER + "paragraphsInHeadingsUa1.pdf";
195+
String destinationPdfUa2 = DESTINATION_FOLDER + "paragraphsInHeadingsUa2.pdf";
196+
197+
convertToUa1AndCheckCompliance(sourceHtml, destinationPdfUa1, cmpPdfUa1, true, null);
198+
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
199+
}
200+
189201
@Test
190202
// TODO DEVSIX-8864 PDF 2.0: Destination in GoTo action is not a structure destination
191203
public void pageBreakAfterAvoidTest() throws IOException, InterruptedException {
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Headings and Paragraphs</title>
6+
<style>
7+
h1 { color: darkblue; text-align: center; }
8+
h2 { color: darkred; }
9+
h3 { font-style: italic; }
10+
h4 { text-transform: uppercase; }
11+
p { font-size: 14px; color: gray; }
12+
</style>
13+
</head>
14+
<h1>
15+
Heading 1
16+
<p>This is a paragraph inside H1.</p>
17+
</h1>
18+
<h2>
19+
Heading 2
20+
<p>This is a paragraph inside H2.</p>
21+
</h2>
22+
<h3>
23+
Heading 3
24+
<p>This is a paragraph inside H3.</p>
25+
</h3>
26+
<h4>
27+
Heading 4
28+
<p>This is a paragraph inside H4.</p>
29+
</h4>
30+
<h5>
31+
Heading 5
32+
<p>This is a paragraph inside H5.</p>
33+
</h5>
34+
<h6>
35+
Heading 6
36+
<p>This is a paragraph inside H6.</p>
37+
</h6>
38+
</html>

0 commit comments

Comments
 (0)