Search code examples
elementblockxsl-foapache-fopline-breaks

FOP: unwanted linebreaks in nested <fo:block> elements


I have a Problem conecerning FOP. I am using CKEditor to create an XSL-Fo String and transform that into a PDF using FOP. Everything works fine, but when using nested blocks, I experience linebreaks in the PDF that should not exist.

XSF-FO:
...<fo:block>ONE<fo:block font-weight="bold">TWO</fo:block><fo:block font-style="italic">THREE</fo:block><fo:block text-decoration="underline">vier</fo:block><fo:block class="linebreak"/></fo:block>...

(The XSL-FO is not complete, the root element and other things are missing. But as other things things like tables and lists are working just fine, there should not be any errors in the document structure.)

The resuling PDF looks somewhat like this:

ONE
TWO
THREE

I just have no idea why? Thx in advance for an help :)


Solution

  • fo:block always takes a whole line. If you need few items on line you can use fo:inline (to change font, colour etc.) or tables (if you also need to control width of items)