@@ -502,6 +502,7 @@ public void largeTableWithLayoutResultNothingTest03() throws IOException, Interr
502
502
}
503
503
504
504
@ Test
505
+ // TODO(DEVSIX-1664)
505
506
public void largeTableOnDifferentPages01 () throws IOException , InterruptedException {
506
507
String testName = "largeTableOnDifferentPages01.pdf" ;
507
508
String outFileName = destinationFolder + testName ;
@@ -529,7 +530,45 @@ public void largeTableOnDifferentPages01() throws IOException, InterruptedExcept
529
530
// change the third page's size
530
531
if (i == 20 ) {
531
532
pdfDoc .setDefaultPageSize (PageSize .A5 .rotate ());
533
+ }
534
+ }
535
+
536
+ table .complete ();
537
+
538
+ doc .close ();
539
+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , testName + "_diff" ));
540
+ }
541
+
542
+ @ Test
543
+ public void largeTableOnDifferentPages01A () throws IOException , InterruptedException {
544
+ String testName = "largeTableOnDifferentPages01A.pdf" ;
545
+ String outFileName = destinationFolder + testName ;
546
+ String cmpFileName = sourceFolder + "cmp_" + testName ;
547
+
548
+ PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outFileName ));
549
+ Document doc = new Document (pdfDoc , PageSize .A4 .rotate ());
532
550
551
+ float [] colWidths = new float []{200 , -1 , 20 , 40 };
552
+
553
+ Table table = new Table (UnitValue .createPointArray (colWidths ), true );
554
+ doc .add (table );
555
+
556
+ table .addFooterCell (new Cell (1 , 4 ).add ("Footer" ));
557
+ table .addHeaderCell (new Cell (1 , 4 ).add ("Header" ));
558
+
559
+ // change the second page's size
560
+ pdfDoc .setDefaultPageSize (PageSize .A3 .rotate ());
561
+
562
+ for (int i = 0 ; i < 25 ; i ++) {
563
+ table .addCell (new Cell ().add ("Cell#" + (i *4 + 0 )));
564
+ table .addCell (new Cell ().add ("Cell#" + (i *4 + 1 )));
565
+ table .addCell (new Cell ().add ("Cell#" + (i *4 + 2 )));
566
+ table .addCell (new Cell ().add ("Cell#" + (i *4 + 3 )));
567
+ table .flush ();
568
+
569
+ // change the third page's size
570
+ if (i == 15 ) {
571
+ pdfDoc .setDefaultPageSize (PageSize .A5 .rotate ());
533
572
}
534
573
}
535
574
0 commit comments