I have a list of objects that I want to iterate over using Freemarker to produce a FOP template that shows four of these items on each page.
Each item should take up a quarter of the page.
In HTML I would probably float the divs so they flow together as they fit the page, but I don't know how to do that with FOP.
I've tried using inline elements to achieve this, but that doesn't work as I expect.
<fo:page-sequence master-reference="apage">
<fo:flow flow-name="xsl-region-body">
<fo:block>
<#list entries as entry>
<fo:inline background-color="blue" border="2px solid black">
<fo:block height="100mm" width="150mm" background-color="red" border="2px solid green">
<#include "singleCardTemplate.ftl">
</fo:block>
</fo:inline>
</#list>
</fo:block>
</fo:flow>
</fo:page-sequence>
The singleCardTemplate.ftl included is responsible for rendering a single item, which seems to be working, only it renders at full width, not 150mm as I'd hoped. I'd like 2x150mm wide blocks next to each other with 2 more underneath. So four per page.
I'm happy the Freemarker/FOP combo is working properly, I do get a PDF generated with the correct content and some borders/colours as per above.
What am I doing wrong?