I create a PdfPCell and add three Paragraph objects in it. The Paragraph 
object in the middle contains only a space to create an empty line. After the 
adding of these three Paragraph objects I set the rotation of the table cell 
to 90. The problem is, that the table cell ranges over the complete side. If 
the paragraph in the middle contains text instead of the space everthing is 
ok. Any idea what I could do to fix this problem?

Codeexample:

Document document = new Document(PageSize.A4);
System.out.println("Tables");

try {
  PdfWriter.getInstance(document,
  new FileOutputStream("Test.pdf"));

  document.open();

  Paragraph paragraphA = new Paragraph();
  ParagraphA.add(new Phrase("TestA"));
  Paragraph paragraphB = new Paragraph();
  paragraphB.add(new Phrase(" "));
  Paragraph paragraphC = new Paragraph();
  paragraphC.add(new Phrase("TestB"));

  PdfPTable table = new PdfPTable(1);
  PdfPCell cell = new PdfPCell();
  cell.addElement(paragraphA);
  cell.addElement(paragraphB);
  cell.addElement(paragraphC);
  cell.setRotation(90);
  table.addCell(cell);
  
  document.add(table);
} catch (DocumentException de) {
  System.err.println(de.getMessage());
} catch (IOException ioe) {
  System.err.println(ioe.getMessage());
}



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to