@@ -45,7 +45,6 @@ This file is part of the iText (R) project.
45
45
import com .itextpdf .io .LogMessageConstant ;
46
46
import com .itextpdf .kernel .color .Color ;
47
47
import com .itextpdf .kernel .geom .PageSize ;
48
- import com .itextpdf .kernel .geom .Rectangle ;
49
48
import com .itextpdf .kernel .pdf .PdfDocument ;
50
49
import com .itextpdf .kernel .pdf .PdfWriter ;
51
50
import com .itextpdf .kernel .utils .CompareTool ;
@@ -56,12 +55,8 @@ This file is part of the iText (R) project.
56
55
import com .itextpdf .layout .element .Cell ;
57
56
import com .itextpdf .layout .element .Paragraph ;
58
57
import com .itextpdf .layout .element .Table ;
59
- import com .itextpdf .layout .layout .LayoutArea ;
60
- import com .itextpdf .layout .layout .LayoutContext ;
61
- import com .itextpdf .layout .layout .LayoutResult ;
62
58
import com .itextpdf .layout .property .Property ;
63
59
import com .itextpdf .layout .property .UnitValue ;
64
- import com .itextpdf .layout .renderer .TableRenderer ;
65
60
import com .itextpdf .test .ExtendedITextTest ;
66
61
import com .itextpdf .test .annotations .LogMessage ;
67
62
import com .itextpdf .test .annotations .LogMessages ;
@@ -1084,7 +1079,7 @@ public void tableWithHeaderFooterTest06A() throws IOException, InterruptedExcept
1084
1079
cmpFileName = sourceFolder + cmpPrefix + fileName ;
1085
1080
1086
1081
PdfDocument pdfDocument = new PdfDocument (new PdfWriter (outFileName ));
1087
- Document doc = new Document (pdfDocument , PageSize .A6 .rotate (), false );
1082
+ Document doc = new Document (pdfDocument , PageSize .A6 .rotate (), false );
1088
1083
1089
1084
Table table = new Table (5 );
1090
1085
Cell cell = new Cell (1 , 5 ).add (new Paragraph ("Table XYZ (Continued)" )).setHeight (30 ).setBorderBottom (new SolidBorder (Color .RED , 20 ));
@@ -1107,7 +1102,7 @@ public void tableWithHeaderFooterTest06B() throws IOException, InterruptedExcept
1107
1102
cmpFileName = sourceFolder + cmpPrefix + fileName ;
1108
1103
1109
1104
PdfDocument pdfDocument = new PdfDocument (new PdfWriter (outFileName ));
1110
- Document doc = new Document (pdfDocument , PageSize .A6 .rotate (), false );
1105
+ Document doc = new Document (pdfDocument , PageSize .A6 .rotate (), false );
1111
1106
1112
1107
Table table = new Table (5 );
1113
1108
Cell cell = new Cell (1 , 5 ).add (new Paragraph ("Table XYZ (Continued)" )).setHeight (30 ).setBorderBottom (new SolidBorder (Color .RED , 20 ));
@@ -1450,7 +1445,46 @@ public void tableWithHeaderFooterTest16() throws IOException, InterruptedExcepti
1450
1445
doc .close ();
1451
1446
Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , testName + "_diff" ));
1452
1447
}
1453
-
1448
+
1449
+ @ Ignore ("DEVSIX-1320" )
1450
+ @ Test
1451
+ public void tableWithHeaderFooterTest17 () throws IOException , InterruptedException {
1452
+ String testName = "tableWithHeaderFooterTest17.pdf" ;
1453
+ String outFileName = destinationFolder + testName ;
1454
+ String cmpFileName = sourceFolder + "cmp_" + testName ;
1455
+
1456
+ PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outFileName ));
1457
+ Document doc = new Document (pdfDoc );
1458
+
1459
+ String textByron =
1460
+ "When a man hath no freedom to fight for at home,\n " +
1461
+ " Let him combat for that of his neighbours;\n " +
1462
+ "Let him think of the glories of Greece and of Rome,\n " +
1463
+ " And get knocked on the head for his labours.\n " +
1464
+ "\n " +
1465
+ "To do good to Mankind is the chivalrous plan,\n " +
1466
+ " And is always as nobly requited;\n " +
1467
+ "Then battle for Freedom wherever you can,\n " +
1468
+ " And, if not shot or hanged, you'll get knighted." ;
1469
+
1470
+
1471
+ Table table = new Table (2 );
1472
+ table .setKeepTogether (true );
1473
+
1474
+ int bigRowspan = 5 ;
1475
+ table .addCell (new Cell (bigRowspan , 1 ).add ("Big cell" ).setBorder (new SolidBorder (Color .GREEN , 20 )));
1476
+ for (int i = 0 ; i < bigRowspan ; i ++) {
1477
+ table .addCell (i + " " + textByron );
1478
+ }
1479
+
1480
+
1481
+ doc .add (new Paragraph ("Try to break me!" ));
1482
+ doc .add (table );
1483
+
1484
+ doc .close ();
1485
+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , testName + "_diff" ));
1486
+ }
1487
+
1454
1488
@ Test
1455
1489
@ LogMessages (messages = {
1456
1490
@ LogMessage (messageTemplate = LogMessageConstant .ELEMENT_DOES_NOT_FIT_AREA , count = 2 )
0 commit comments