Skip to content

Commit f381eb4

Browse files
committed
Support Table related rules for PDF/UA-2
DEVSIX-8955
1 parent f372ea9 commit f381eb4

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ public void extensiveRepairTaggingStructRepairTest() throws IOException, Interru
296296
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
297297
}
298298

299-
300299
@Test
301300
public void inputFieldsUA2Test() throws IOException, InterruptedException {
302301
String sourceHtml = SOURCE_FOLDER + "input.html";
@@ -335,12 +334,22 @@ public void complexParagraphStructure() throws IOException, InterruptedException
335334
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_complexParagraphStructure.pdf";
336335
String destinationPdfUa2 = DESTINATION_FOLDER + "complexParagraphStructure.pdf";
337336

337+
convertToUa1AndCheckCompliance(sourceHtml, destinationPdfUa1, cmpPdfUa1, true, null);
338+
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
339+
}
338340

341+
@Test
342+
public void emptyTableDataCellTest() throws IOException, InterruptedException {
343+
String sourceHtml = SOURCE_FOLDER + "emptyTableDataCell.html";
339344

340-
convertToUa1AndCheckCompliance(sourceHtml, destinationPdfUa1, cmpPdfUa1, true, null);
345+
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_emptyTableDataCellUa1.pdf";
346+
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_emptyTableDataCellUa2.pdf";
341347

342-
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
348+
String destinationPdfUa1 = DESTINATION_FOLDER + "emptyTableDataCellUa1.pdf";
349+
String destinationPdfUa2 = DESTINATION_FOLDER + "emptyTableDataCellUa2.pdf";
343350

351+
convertToUa1AndCheckCompliance(sourceHtml, destinationPdfUa1, cmpPdfUa1, true, null);
352+
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
344353
}
345354

346355
private static void compareAndCheckCompliance(String destinationPdf, String cmpPdf, boolean isExpectedOk)
Binary file not shown.
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<html>
2+
<body>
3+
<table style="border-collapse: collapse;">
4+
<tr>
5+
<th style="border:1px solid black;" scope='col'>test</th>
6+
<th style="border:1px solid black;" scope='col'>test</th>
7+
</tr>
8+
9+
<tr>
10+
<td style="border:1px solid black;">test</td>
11+
<td style="border:1px solid black;"></td>
12+
</tr>
13+
</table>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)