Bruno, you suggest to use setFixedHeight, but this only works if the text is 
horizontally alignment LEFT, but I have the same problem with RIGHT alignment, 
and if the text is split with spaces (which is normal), only the firs split is 
shown, not the last.

Text: some dogs are black, others are red.

so now if lets say the with of the column is ENOUGH to catch only "other are 
red" and if i use setNoWrap(false), and setFixedHeight(smth) the text which 
will be showing in the cell will be "some dogs are", because the horizontal 
alignment is set to Right

The thing is that i have succeeded to wrap text in normal situations with the 
PdfContentByte.clip() method no matter the horizontal alignment, but in the 
table cells is not that simple, and i'm trying to achieve the same thing. It 
should look similar to the MS Excel cell wrapping - when there are 2 neighbour 
cell and they are both fill with text, if the text of the left or right one is 
wider then the with of the cell, it is "clapped" (not showing but is there).

----------------------------------------------------------
Original Message - found in the mailing list Archives
----------------------------------------------------------

Hevn wrote:

I have a PdfPTable and I have set the widths for each column like this:
float[] widths2 = {0.14f, 0.17f, 0.14f, 0.31f, 0.08f, 0.09f, 0.07f};

Now I want the texts inside the cells to not be wrapped so I have this line: 
cell.setNoWrap(true);

What happens is the data overflows to the next cell.

That is the expected behaviour.
If on the other hand, you use setFixedHeight so that only
one line fits in the cell, then the content will not be wrapped
and the part that doesn't fit will be omitted.

Is there a way to unwrap the text inside the cell without overflowing?

If you are talking about changing the width of the cell dynamically
based on its content: No, this isn't possible.
br,
Bruno


-----------------------------------------------------------------
Избери от 30 000 заглавия с най-големите отстъпки в WWW.MOBILIS.BG

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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