As for dynamically sizing the HEADER/FOOTER regions, I use the following system:
In my XSL-FO documents, the HEADER (fo:region-before) & FOOTER (fo:region-after) are dynamically sized according to the number of lines which will print (the HEADER is a little more complex, because it has a minimum size, and in certain cases gets larger). The FOOTER is pretty simple. I count the number of lines which will print (up to 6), and multiple that count() by my line-height (.3cm). The line-height will vary depending on the font-family and font-size you choose. In addition, I've found that the output from -pdf and -ps tends to be smaller, so you may have to play with it a bit. Thank goodness for re-cycled paper!
I hope this helps!
Web Maestro Clay
p.s. Here's some code to get you started. (it's edited from my "real" stuff--hopefully it still works!)
<!-- ============================== -->
<!-- BEGIN - ATTRIBUTES and VARIABLES SECTION -->
<!-- ======== -->
<!-- BEGIN - "Dynamic Header and Footer SIZE" VARs -->
<!-- varUnitOfMeasure_DEFAULT | minimum height for EOR - default: cm -->
<xsl:variable name="varUnitOfMeasure_DEFAULT">cm</xsl:variable>
<!-- varHeaderMinHeight_DEFAULT | minimum height for EOR - default:5.15 (cm) -->
<xsl:variable name="varHeaderMinHeight_DEFAULT">5.15</xsl:variable>
<!-- varLineHeight_DEFAULT | line height for EOR - default:.3 (cm) -->
<xsl:variable name="varLineHeight_DEFAULT">.3</xsl:variable>
<!-- varHeadingLineHeight_DEFAULT | Heading line height for EOR (includes "Continued on next page..." line) - default:1.25 (cm) -->
<xsl:variable name="varHeadingLineHeight_DEFAULT">1.25</xsl:variable>
<!-- varHeadingFontSize_DEFAULT | font-size for Headings - default=9pt - -->
<!-- END - "Dynamic Header and Footer SIZE" VARs -->
<!-- ======== -->
<fo:layout-master-set>
<fo:simple-page-master master-name="repeating" page-height="28cm" page-width="22cm" margin-top="1cm" margin-bottom="1.5cm" margin-left="1cm" margin-right="0cm">
<fo:region-body margin-top="2cm">
<xsl:attribute name="margin-top"><xsl:value-of select="format- number($varHeaderMinHeight_DEFAULT+2*$varLineHeight_DEFAULT,'#.00')"/ ><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
<xsl:attribute name="margin-bottom"><xsl:value-of select="format-number(count(EOB/TRAILER/TRAILERLINE[.! =''])*$varLineHeight_DEFAULT+$varHeadingLineHeight_DEFAULT,'#.00')"/ ><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
</fo:region-body>
<fo:region-before>
<xsl:attribute name="extent"><xsl:value-of select="format- number($varHeaderMinHeight_DEFAULT+2*$varLineHeight_DEFAULT,'#.00')"/ ><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
</fo:region-before>
<fo:region-after>
<xsl:attribute name="extent"><xsl:value-of select="number(count(EOB/TRAILER/TRAILERLINE[.! =''])*$varLineHeight_DEFAULT+$varHeadingLineHeight_DEFAULT)"/><xsl: value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
</fo:region-after>
</fo:simple-page-master>
<fo:page-sequence-master master-name="repeating_pm">
<fo:repeatable-page-master-reference master-name="repeating"/>
</fo:page-sequence-master>
</fo:layout-master-set>
On Jan 16, 2004, at 7:16 AM, Readman, Devon wrote:
Hi Everyone.
I'm trying to include a text 'note' value in the dynamic running header of my pdf output. Currently, I'm using fo:marker to set the heading value when processing which is retrieved within the fo:region-before. This works fine as there are always only two lines of text so a set width is big enough. Since the text 'note' can vary throughout the document I need to be able to resize the fo:region-before through the use of a xsl:variable. Can you set the value of a xsl:variable to the value of a fo:marker? I've tried with no success -- just a hardcoded variable value works.
Thanks.
Devon
<fo:simple-page-master master-name="large_footer">
<xsl:variable name="size">
<xsl:text disable-output-escaping="yes">1.1in</xsl:text>
</xsl:variable>
<fo:region-body margin-top="{$size}" margin-bottom="0.5in"/>
<fo:region-before overflow="scroll" extent="{$size}"/>
<fo:region-after extent="0.5in"/>
</fo:simple-page-master>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]