You are not doing anything wrong. In the first case addElement() keeps the spacing and alignment of par and you can call it again with another par with different attributes. In the second case par will be converted in a sequence of Chunk and the spacing and alignment will be set by the cell parameters. See the ColumnText.addElement() javadoc.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Rustam > Sent: Monday, December 27, 2004 3:17 AM > To: [email protected] > Subject: [iText-questions] multiple paragraphs in a table > cell - problem with line spacing > > Hi all, > I'm not sure if I'm using itext correctly, but the following > 2 pieces of > code work differently for me: > PdfPCell cell = new PdfPCell(); > cell.addElement(par); > table.addCell(cell); > and > PdfPCell cell = new PdfPCell(par); > table.addCell(cell); > > I've attached the test java program and the resulting PDF > created using the > latest version of itext. > > Please let me know what I'm doing wrong, and how I can fix > this, because I > really need to be able to add multiple paragraphs to a table cell. > > Thanks in advance, > > - Rustam - > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
