Page 1 of 1

Wrapping text

Posted: Fri Nov 18, 2005 3:16 pm
by kirashet
Hi there,

if I have followed XML entity

<contactperson>
Prename Surname
Telephone Number
</contactperson>

and the associated XSL Snippet

<fo:table-cell>
<fo:block text-align="left"
font-size="11pt"
font-family="Courier"
line-height="14pt">
<xsl:apply-templates select="contactperson"/>
</fo:block>
</fo:table-cell>

it's in the resulted PDF like that: "Prename Surname Telephone Number".

Bud I'd like to have a wrap after "Prename Surname".

How to handle this?
Any ideas?

Greets
kirashet

Have you tried wrap-option="wrap"?

Posted: Mon Jan 16, 2006 1:56 pm
by Franck
I am still an FO newby, but with apache FOP 0.90:

I have found that wrap-option="wrap" does the trick. It also seem that wrap is the default, so I don't actually need to specify it.

Look also at linefeed-treatment="preserve" | "ignore"

and

hyphenate="false" or "true".

There is currently a problem with combining linefeed-treatment="preserve" and hyphenate="true", but I am sure they'll fix it soon.

<fo:block language="en"
wrap-option="wrap"
linefeed-treatment="preserve" white-space-collapse="false"
hyphenate="false" hyphenation-push-character-count="2"
hyphenation-remain-character-count="2" space-after.optimum="3pt">
TELL ME, O MUSE, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy.
Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god Hyperion; so the god prevented them from ever reaching home.
Tell me, too, about all these things, O daughter of Jove, from whatsoever source you may know them.
</fo:block>

Hope this helps