On 28/10/2011 22:47, Elextra wrote:
> Hi you guys,
>
> I have a quick question about hyphens and how they are treated in pdfcells 
> (via
> chunks).
> I have a table with many rows. Each row contains text, which might contain
> hyphens. What I have noticed is that when my row is longer than the text width
> for the row (leading I think it's called), then the text is wrapped
> automatically by itext in the cell. So far so good.
> But, when that text contains a hyphen ("-"), it gets broken down according to
> that hyphen.
>
> Ex:
> "Assuming this-is a long text that spawns two lines" will appear as such in my
> table.
>
>
> Assuming this-
> is a long text that spawns two lines
>
> Where as I would like the hyphen to be ignored and basically have itext break
> down the text naturally when it reaches the cell max width.
>
If you don't want iText to split a line on a hyphen, you have two options:
- use a "hard hyphen" (aka a "non breaking hyphen") character (\u2011) 
instead of a "soft hyphen" (\u002d).
- create your custom implementation of the SplitCharacter interface and 
use that interface to control the way iText splits lines.

I'd prefer using the hard hyphen because the description you give of the 
desired behavior corresponds with what is to be expected of a 
"non-breaking hyphen". Seems that you're using a soft hyphen by mistake.

------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World™ now supports Android™ Apps 
for the BlackBerry® PlayBook™. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to