[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Trouble positioning "fo:block" at the bottom of the pa

Subject: Trouble positioning "fo:block" at the bottom of the page
From: "Struijk, Toon van der" <aecvanderstruijk@xxxxxxxxx>
Date: Mon, 7 Feb 2011 10:25:46 +0100
 Trouble positioning "fo:block" at the bottom of the pa

First of all, I must 'warn' you; I'm very new to XSL-FO.
So, it could be that my question is already covered elsewhere, or that the
answer to my question is just common knowledge to experienced XSL-FO stylers.

My question:
I want a piece of text (sort of final notes in a brochure) to appear at the
bottom of the last page if that page has room for it. If there is no room for
it, I want it to appear at the next page, but also at the bottom of it. This
means that when the regular content of the brochure has reached the end, I add
the 'final notes'.
Suppose these 'final notes'  take up a third of a page, and the last piece of
regular content is less then two thirds of the page, the 'final notes' have
enough room to be put on the bottom of the same page where the regular content
ended. When the regular content fills more than two thirds of the last page,
there is not enough room for the 'final notes' to be put there, and in that
case the 'final notes' must appear on the bottom of the next page.
I have tried a lot of different scenarios to accomplish this, but it means
mostly two situations:
1.	The 'final notes' are actually put at the bottom of the last page, but
overlapping the regular content
2.	The 'final notes' are put on a separate page but at the top of it.

After a lot of 'trial and error' I gave up, and created a new
'fo:page-sequence' with the sole purpose to put the 'final notes' always at
the bottom of a newly created page (which is then the last page). This can
lead to a situation where the regular content ends with only four or five
lines of content (so there is enough room on that page for the 'final notes'),
and on a brand new page the 'final notes' are placed. This is not acceptable.

This is the XSL-FO code I'm working on (the 'final notes' are called
'extrainfo'). As you can see I use the 'absolute position="fixed" and
'bottom="0pt"' to put this block of content at the bottom of the page.

       <xsl:template match="extrainfo">
             <fo:block-container keep-together.within-page="always"
left="10pt" space-before="24pt" absolute-position="fixed" bottom="0pt">
                    <fo:block-container >
                           <fo:block font-size="{$FontSizeNormal}"
letter-spacing="{$LetterSpacing}" line-height="{$LineHeight}"
font-weight="normal" ><xsl:apply-templates select="extrabody"/></fo:block>

In my 'fo:page-seqeunce' I use the following code:
As you can see I put the 'extrainfo' as the last part in the first 'fo:flow'.
This works as long as I don't use the 'absolute position="fixed"' in the
'fo:block-container'.  In this case the content of 'extrainfo' is put at the
bottom, but overlaps exisiting content.

       <fo:page-sequence master-reference="Leaflet"
font-family="MyriadPro-Regular" hyphenate="true" language="nl" widows="2"
orphans="2" hyphenation-push-character-count="3"
hyphenation-remain-character-count="3" initial-page-number="1">
             <fo:flow flow-name="xsl-region-body">
                    <fo:block language="nl" country="nl">
                           <xsl:apply-templates select="head" />
                           <xsl:apply-templates select="afsprakenblok" />
                           <xsl:apply-templates select="body" />
                           <xsl:apply-templates select="extrainfo" />

             <fo:static-content flow-name="A4-footer">
                    <fo:block margin-top="17.5pt" border-width="0.5pt"
border-color="black" border-top-style="solid" border-bottom-style="none"
border-left-style="none" border-right-style="none">
                           <fo:block margin-top="2.65mm"
font-size="{$FontSizeNormal}" letter-spacing="{$LetterSpacing}" >
                                  <xsl:apply-templates select="footer/strong"
/>, <xsl:apply-templates select="footer/footerafdeling" />,
<xsl:apply-templates select="footer/footernummer" />/ <xsl:apply-templates
select="footer/footerdatum" />
                                  <fo:block margin-top="-3mm" text-align="end"
                                        <fo:page-number />

             <fo:flow flow-name="Location">
                    <fo:block margin-top="275pt" margin-left="5mm"
><xsl:apply-templates select="locatie"/></fo:block>

(Oh, and don't get fooled by all the Font definitions. I now know how to
separate these and put them in a single XSL file.)

By the way, I don't know how much content goes in the regular content and how
much goes in the 'extrainfo' or 'final notes'. So I cannot work with strict
Any help on my question would be greatly appreciated. And if someone needs to
see more code or whatever, please let me know.

Met vriendelijke groet,
Toon van der Struijk
Elektronicaweg 31
2628 XG Delft, Nederland

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.