As long as they have a fixed width and they don’t expect things to “float” dynamically in width, for example, css, I did this (using the vertical “Sliding doors” technique, if you remember the old css school):
Get an image with a rounded corner of the background and get it as long as you expect to be on the page (note that if you expect events to appear on several pages, then this will not develop so well). I use it in headers and footers and things that start a new page (in the body area), which I know will not be more than 1 page.
Then I decide if I need a fixed height ... if you can just use the background image without fantasy ...
if the height changes then I just use the top of the image for one part and the bottom of the image for the other. something like that:
<fo:block-container> <fo:block-container background-image="url(images/rounded_corner_image.png)" background-repeat="no-repeat" background-position-horizontal="15px" background-position-vertical="top" background-color="white" > <fo:block margin="70px 70px 0px 70px"> Need to add some margins before starting content since dont want to text to touch the top and sides of of the rounded corner/borders plus add whitespace for content. </fo:block> </fo:block-container> <fo:block-container background-image="url(images/rounded_corner_image.png)" background-repeat="no-repeat" background-position-horizontal="15px" background-position-vertical="bottom" padding="0px 0px 20px 0px" background-color="white" > <fo:block margin="0px 70px 70px 70px"> Need to add some margins before starting content since dont want to text to touch bottom and sides of of the rounded corner/borders. </fo:block> </fo:block-container> </fo:block-container>
Theres various ways to go for it I think. for example, I had content at the bottom, so I just use the bottom, knowing that I will have at least 70 pixels of content to show the bottom gradient of my rounded corners .... you can just decide to put all my content in the first block-container and gives the 2nd block container a fixed height of 70 pixels to display only the lower background image (I think this is possible even if there is no content in this lower container [forget xsl-fo rules]). Using the FOP trunk and works great.
EDIT: I have to note that I use the latest FOP 1.0 (also tried with the previous version) and it works well. In addition, I used the graphics as high as the content will be, since I have borders ... If you just need the upper and lower graphics (and background color to fill the body, then you don't need the full as-tall-as "-possible image).
armyofda12mnkeys
source share