Skip to content

Commit 9bb4e9f

Browse files
committed
Add new layout tests and link them with todos.
DEVSIX-1664
1 parent cbf02be commit 9bb4e9f

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

layout/src/test/java/com/itextpdf/layout/LargeElementTest.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ public void largeTableWithLayoutResultNothingTest03() throws IOException, Interr
502502
}
503503

504504
@Test
505+
// TODO(DEVSIX-1664)
505506
public void largeTableOnDifferentPages01() throws IOException, InterruptedException {
506507
String testName = "largeTableOnDifferentPages01.pdf";
507508
String outFileName = destinationFolder + testName;
@@ -529,7 +530,45 @@ public void largeTableOnDifferentPages01() throws IOException, InterruptedExcept
529530
// change the third page's size
530531
if (i == 20) {
531532
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());
532550

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());
533572
}
534573
}
535574

0 commit comments

Comments
 (0)