2

指定された幅と回転されたテキストを使用してテーブル内のセルをレンダリングするバグがあるようです。回転角度が (Math.PI / 2) の場合、テキストは隣接するセルに裁ち落とし、回転角度が -(Math.PI / 2) の場合、セルの高さはページの下部まで拡張されます。

単体テストは次のとおりです。

@Test
public void tableRotationTest02() throws IOException,InterruptedException {
    String outFileName = OUTPUT_FOLDER + "tableRotationTest02.pdf";
//        String cmpFileName = sourceFolder + cmpPrefix + "tableRotationTest02.pdf";

//        FileOutputStream file = new FileOutputStream(outFileName);
    PdfWriter writer = new PdfWriter(outFileName);
    PdfDocument pdfDoc = new PdfDocument(writer);
    Document doc = new Document(pdfDoc);

    Table table = new Table(new float[]{25, 50})
            .addCell(new Cell().add(new Paragraph("cell 1, 1").setRotationAngle((Math.PI / 2))))
            .addCell(new Cell().add(new Paragraph("cell 1, 2").setRotationAngle((Math.PI / 3))))
            .addCell(new Cell().add(new Paragraph("cell 2, 1").setRotationAngle(-(Math.PI / 2))))
            .addCell(new Cell().add(new Paragraph("cell 2, 2").setRotationAngle((Math.PI))));
    doc.add(table);

    doc.close();

//        Assert.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, destinationFolder, "diff"));
}
4

1 に答える 1