Re: [xsl] Re: [FO] Margin when a block breaks over a page

Subject: Re: [xsl] Re: [FO] Margin when a block breaks over a page
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Aug 2008 11:56:41 -0400
At 2008-08-19 15:47 +0200, Vincent Hennebert wrote:
Kamal Bhatt wrote:
> Hi,
> I want to ensure that when a block breaks on a new page, the top of the
> content has a certain amount of spacing before it, how can I do this?

You can use the padding-before property:
    <fo:block padding-before.length="20pt"
      padding-before.conditionality="retain">
      Block content...
    </fo:block>

Note that you will also get the space on the first page where the block
appears;

You will also get the padding on *every* block, while the original poster asked only that the space be at the top of the page when a block breaks on a new page (I'm assuming because of the background image).

A second concern is that your suggestion would
only work if the text has no background colour,
otherwise, the background colour of the text is
shown, not the background colour of the parent
construct (in this case the image).  I find in my
classroom that novice users of XSL-FO use padding
where they should be using spacing because they
don't see white on white problems and get into bad habits.

if the block doesnbt have any border you can counteract that by
setting a negative space-before. Contrary to space-before,
padding-before, if it is set to "retain", applies to every page on which
the block appears.

And on every block, which I think goes beyond the requirement.


But maybe what you really want can be achieved in a different way, in
which case a small illustration can help us understand your need.

I agree ... the original post frames the discussion around the background image of the body region, which is why I think my proposed solution being applied to the background image will have the least impact on the rest of the formatting in play.

I hope this helps.

. . . . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread