Use a PdfPTable with a single cell. That cell will contain your 3 lines.
Call PdfPTable.setSplitRows(false) to keep the entries together.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Rob Tanner
> Sent: Monday, January 14, 2008 5:18 PM
> To: Post all your questions about iText here
> Subject: [iText-questions] Another newbie question: how do I
> control columnbreaks using MultiComunText()
>
> I am using iText to build a phone directory and each page
> contains two
> columns and each entry 3 lines of text followed by a blank line. My
> problem is that entries are getting split across columns, and I've
> unsuccessfully tried two different mechanisms to try and control it.
>
> Each entry is a PdfPTable() containing 4 rows. so, I've tried using
> setKeepTogether(true). According to the Javadoc, "If true the table
> will be kept on one page if it fits, by forcing a new page if
> it doesn't
> fit on the current page." Does that not work properly with
> MultiColumnText() (i.e., forces a new column) or is there something I
> need to do besides simply setting setKeepTogether() to true?
>
> The other mechanism I tried was to use the MultiColumnText() method
> nextColumn() after adding 15 table entries by using a counter
> that gets
> reset after every call to the nextColumn() method. But instead of
> getting a new column every 15 entries, the first column on the first
> page was skipped and after that calls to nextColumn() appear to be
> ignored. nextColumn() obviously doesn't work the way I think it does.
>
> What is an appropriate way to ensure that no table splits
> across a column?
>
> Thanks,
> Rob
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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/