Question

A while ago I found out that FOP doesn't allow you to use floats, and a few other features in Xsl-Fo 1.0. I've tried a few different ways to emulate them, but I have had no success. If anyone has had success in this, or has an idea. I would really appreciate enlightenment.

Was it helpful?

Solution

http://xmlgraphics.apache.org/fop/compliance.html lists which features of XSL-FO are supported in Apache FOP and which are not. Floats have not been implemented, yet.

OTHER TIPS

I know this is an old question, but I had the same problem (I couldn't use float and also couldn't upgrade to a version where I could use float). I finally settled on keeping an image between two text blocks, the preceding textblock with keep-with-next="always" and the text after the image with keep-with-previous="always".

I found these examples online here. So the text doesn't wrap around the image, but it's above and below the image (it works for large images where text wouldn't wrap around the sides anyway, which was my case, and the preceding/following text isn't too much).

It's about 4 years late, but I've managed to get a Table to float right by a bit of...trickery.

fo:table width="15cm"
fo:table-column column-width="7cm"/
fo:table-column column-width="3cm"/
fo:table-column column-width="5cm"/
fo:table-row
fo:table-cell border="none"
[Intentionally left blank]
/fo:table-cell
fo:table-cell border="solid"
[Content of 3cm column]
/fo:table-cell
fo:table-cell border="solid"
[Content of 5cm column]
/fo:table-cell
/fo:table-row
/fo:table

By no means is this an elegant or reliable solution, but it's worth remembering, in case you ever need to align a table specifically. A similar solution might work with a blank block and another block made to stay on the same line, but I have not tested this in my own useage, so your results my vary.

Sorry I could not offer a general case solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top