W3C home > Mailing lists > Public > www-xsl-fo@w3.org > October 2009

RE: conditional page break

From: Tamsin <tamsin@anorakgirl.co.uk>
Date: Thu, 22 Oct 2009 13:16:36 +0100
To: <www-xsl-fo@w3.org>
Message-ID: <0718454654F145FFA85408349B4447D5@elg224>
Hi,

Thanks very much for this - it confirms what I was thinking. Hadn't thought
of the workaround of running just block A first and getting a page count, so
may try that. My document has a lot of sections all with block A's though so
could see this slowing the process down a lot.

Thanks again,
Tamsin


-----Original Message-----
From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On Behalf
Of John Virgo
Sent: 22 October 2009 09:06
To: www-xsl-fo@w3.org
Subject: Re: conditional page break


I've had the same problem in a long running project (2 years) that I am
still
working.

I call this problem 'layout feedback', or lack of. The problem is there is
no accurate way of determining if 'block A fits' into any area until the FO
has been laid out so your XSL will not be able to make the decision.

I've worked around this in several ways, none of which are pretty:
* Run a template for just block A and check the page count output, to make
the decision of which template to use.
* Manually calculate the size of block A using the font size and known
quantities of the layout directly in the FO.
* As above but with custom pre-parsing code on the input XML passing a
parameter to the XSL template.

I'm sure there were more I tried but nothing worked particularly well, in
the end we hand to settle for allow our QA users to make the decision using
a tick box on the form displaying (and regenerating) the output.

JV



Tamsin-3 wrote:
> 
> Hi,
> 
>  
> 
> I am trying to find a way to conditionally start a new page within a PDF.
> Basically, if block A fits on one page, even with space remaining, block B
> should start on a new page. But if block A runs onto the next page, block
> B
> should start straight after block A. 
> 
>  
> 
> I can't see a way to do this - I first looked into comparing the page
> numbers, but obviously you can't do this at the XSL step of the process.
> Wondered if anyone can suggest a solution?
> 
>  
> 
> Thanks,
> 
> Tamsin
> 
>  
> 
>  
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/conditional-page-break-tp25979086p26005680.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
Received on Thursday, 22 October 2009 12:17:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 22 October 2009 12:17:12 GMT