Rendering blocks side by side with FOP

I need to create a PDF from XML data using Apache FOP. The problem is that FOP does not support fo: float, and I really need to have elements (boxes with displayed data) side by side in the PDF. More precisely, I need them in a 4x4 grid on each page, for example:

enter image description here

In HTML, I would just visualize them as left floating divs with corresponding widths and heights.

My data looks something like this:

<item id="1"> <a>foo</a> <b>bar</b> <c>baz</c> </item> <item id="2">...</item> ... <item id="n">...</item> 

I considered using a two-zone regional body, but then the order of the elements will be 1, 3, 2, 4 (reading from left to right), since they will display tb-lr instead of lr-tb, and I need them to be in the correct order (id above xml).

I suppose I could try using a table, but I'm not quite sure how to group items into rows in a table.

So, it would be useful to evaluate some workaround for the absence of fo: float.

+4
source share
1 answer

So, as usual, when I post a question, I find the answer in a few minutes. fooobar.com/questions/892132 / ...

Perhaps the formulation of your problem in the message works as a kind of mental help, and you come a little closer to solving the problem before you get one answer. Well. All is well that ends well.

+4
source

Source: https://habr.com/ru/post/1392756/


All Articles