Reputation: 125
I am fop-newbie who is willing to generate PDF using Apache FOP, as described below
[ Imagine A4 page has dimensions 800pt x 600pt. The top 200pt x 600 pt will
hold a image and some meta data about the entity. The space below this region
needs to contain the description, but in two-column format (like newspapers).
Sometimes description is so-big, that it spans mutiple pages. ]
I plan to create .fo file using the data I have, and then get PDF using Apache FOP. When I use
<fo:region-body
margin-top="1cm" margin-bottom="0.25cm"
column-count="2" column-gap="0.25in"/>
:
<fo:external-graphic src="url('image.jpg')"/>
<fo:block ..... >
the image appears, but text starts from the top of the second column on the page, on top of the image. Please guide me, how to go about designing this layout. Any pointers to similar design will be useful. Thanks all
Upvotes: 1
Views: 2120
Reputation: 11
Here's what worked for me.
I wrapped the element(s) in a fo:block
and used the span="all"
attribute on the block. This makes the block span the entire page instead of just its own column.
Example:
<fo:block span="all">
<fo:external-graphic src="image.png"/>
</fo:block>
Some useful resources:
Upvotes: 1
Reputation: 2236
Maybe this is helpful http://cnx.org/content/m43650/latest/
In particular the note Note: The space for the header and footer is taken from the area. Thus this has to be compensated in the definition of by adding margins of at least the extent of the header and footer.
Is it possible to paste a drawing of how you would like the layout to look like?
Upvotes: 0