You can also set the HEADER/FOOTER (fo:region-before/fo:region-after)
programmatically, determining the amount of space required by
counting lines of text (if you're lucky enough to have it divided
into lines!) or characters. In the first section, I specify variables
(minimum header height, line height, and unit of measure). The 2nd
section shows how the FOOTER extent is set based on the number of
lines in the TRAILER, and the 3rd shows the HEADER section is the
minimum height plus one line.
Hope this helps!
Web Maestro Clay
<!-- ======== -->
<!-- BEGIN - myxslfo_default.fo "Dynamic Header and Footer SIZE"
VARs -->
<!-- varUnitOfMeasure_DEFAULT | minimum height for bill -
default: cm -->
<xsl:variable name="varUnitOfMeasure_DEFAULT">cm</xsl:variable>
<!-- varHeaderMinHeight_DEFAULT | minimum height for bill -
default:5.15 (cm) -->
<xsl:variable name="varHeaderMinHeight_DEFAULT">5.15</xsl:variable>
<!-- varLineHeight_DEFAULT | line height for bill - default:.3
(cm) -->
<xsl:variable name="varLineHeight_DEFAULT">.3</xsl:variable>
<!-- varHeadingLineHeight_DEFAULT | Heading line height for
bill (includes "Continued on next page..." line) - default:1.25 (cm) -->
<xsl:variable name="varHeadingLineHeight_DEFAULT">1.25</xsl:variable>
<!-- END - myxslfo_default.fo "Dynamic Header and Footer SIZE"
VARs -->
<!-- ======== -->
<fo:region-after>
<xsl:attribute name="extent"><xsl:value-of select="number(count(/
doc/TRAILER/TRAILERLINE[.!=''])*$varLineHeight_DEFAULT+
$varHeadingLineHeight_DEFAULT)"/><xsl:value-of
select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
</fo:region-after>
<fo:region-before>
<xsl:attribute name="extent"><xsl:value-of select="format-number
($varHeaderMinHeight_DEFAULT+$varLineHeight_DEFAULT,'#.00')"/
><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
</fo:region-before>
On Jun 8, 2006, at 6:02 AM, Jeremias Maerki wrote:
Unfortunately, that's not possible. XSL-FO requires that the extent
of a
side region (like region-before) must be specified absolutely.
That's a
necessity due to the layout process. Otherwise, this could cause
endless
loops due to circular adjustments.
See:
http://www.w3.org/TR/xsl11/#extent
A work-around is to specify a rather large value for region-before and
then investigate the size used up by its content by inspecting the
area
tree XML (-at on the command-line) and then adjusting the value in
your
stylesheet and finally running FOP once more with the effective value.
On 08.06.2006 06:02:42 Nguyen, Thang wrote:
hi,
I use belows to define header/body size.
<fo:region-before region-name="header-first" extent="50pt" />
<fo:region-body margin-top="50pt" margin-bottom="50pt" />
my problem is the content of header might be greater than the size I
defined and part of content does not show up in the header of
document.
Could someone show me how to make header&body autoresize
themselves to
fit the content of the header ?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Web Maestro Clay
[EMAIL PROTECTED]
My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]