inVoKer
inVoKer

Reputation: 59

XSLFO: Wrap <fo:inline/> at a Specific Length

I want to wrap a <fo:inline/> if it exceeds a specific length, for example, 10mm. I use the combination of max-width="10mm" and wrap-option="wrap" attributes. However I cannot get this done. Here is my code:

<fo:list-item>
    <fo:list-item-label end-indent="label-end()">
        <fo:block>1.</fo:block>
    </fo:list-item-label>
    <fo:list-item-body start-indent="body-start()">
       <fo:block keep-with-next.within-page="always">
            <fo:block text-align="left" text-align-last="left">
                <fo:inline max-width="10mm" wrap-option="wrap">
                    A loooooooooooong text should wrap
                </fo:inline>
            </fo:block>
            <fo:leader leader-pattern="dots"
                       leader-pattern-width="1mm"
                       leader-length.minimum="2mm"
                       keep-with-next.within-page="always"/>
            <fo:inline max-width="1mm" wrap-option="wrap">
                Another looooooong text should wrap
            </fo:inline>
       </fo:block>
    </fo:list-item-body>
</fo:list-item>

It looks like this now:

1. A loooooooooooong text should wrap ............... Another loooooong text should wrap

I want it to look like this:

1. A loooooooooong text 
   should wrap ...................... Another loooooong text
                                                 should wrap

Upvotes: 0

Views: 70

Answers (1)

Tony Graham
Tony Graham

Reputation: 8068

Use fo:inline-container, as in my https://stackoverflow.com/a/77115126/4092205 answer to your previous question.

Upvotes: 1

Related Questions