2016-08-01 3 views
1

테이블의 셀을 지정된 너비와 회전 된 텍스트로 렌더링하는 버그가있는 것 같습니다. 회전 각도가 (Math.PI/2)이면 텍스트가 인접 셀로 블리드되며 회전 각도가 - (Math.PI/2)이면 셀 높이가 페이지의 맨 아래까지 확장됩니다. 여기 itext 7 테이블의 셀에서 회전 된 텍스트

은 단위 테스트이다

@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")); 
} 
+1

독립 식 코드 샘플을 제공해 주셔서 감사합니다. 이것은 실제로 버그입니다. 우리는 그것을 살펴볼 것입니다. –

답변