You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Luca Furini <lf...@cs.unibo.it> on 2005/04/21 18:34:03 UTC

Problems with break conditions and empty pages

It seems there is a bug affecting the creation of the right kind of page
for documents containing blocks with break-* = "odd-page" or "even-page".

If break-before = "odd-page" *each* page with some content is odd; even
pages are all empty.

If break-before = "even-page" the content is placed only on even pages,
while odd pages are empty; moreover, if the block with break-before is the
first one in the document it is placed on the first page (which is odd!),
without adding an empty page before.

The same happens with break-after.

I think this could depend on the conditions tested in the methods
PSLM.needEmptyPage() and PSLM.needNewPage(); in particular, the first one
should return false if the first page has already been created, while now
it seems to return always true.

I'll look at this again next week, obviously unless someone finds a fix
before! :-)

Regards
    Luca







RE: Problems with break conditions and empty pages

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]

<snip />
> Also, a break-before="page" on the very first block in the
> document seems to be ignored. Is that correct behaviour?

After consulting the Rec, I'm still a bit confused, but I'm beginning to
think that it *is* correct to drop the very first break-before (or last
break-after), and that one blank page is the maximum between the two blocks
I described earlier...

> Overall, there seems to be something wrong in this logic in
> PSLM.needNewPage() :

So it seems I was wrong about the above. My apologies.

Problem of the first or last odd/even page-break before/after *in* a block
remains...

Greetz,

Andreas


RE: Problems with break conditions and empty pages

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
>
<snip />
> I also tried two fo:blocks, first one with break-after="even-page" and the
> second with break-before="even-page", and I don't know exactly what the
> result is supposed to be, but IIC, if the first block ends on an odd page,
> there should be three blank pages in between (?)

Sorry, that's 'two' blank pages. The second block should start on the third
empty page (= the second even page).

Cheers,

Andreas


RE: Problems with break conditions and empty pages

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Luca Furini [mailto:lfurini@cs.unibo.it]
>
>

Hi,

> It seems there is a bug affecting the creation of the right kind of page
> for documents containing blocks with break-* = "odd-page" or "even-page".
>
<snip />

> I think this could depend on the conditions tested in the methods
> PSLM.needEmptyPage() and PSLM.needNewPage(); in particular, the first one
> should return false if the first page has already been created, while now
> it seems to return always true.

Agreed. Had a quick look, and wondered if it could be caused by the
breakValue being passed in.
If this value is _always_ influenced by the break-* props of the _current_
block, regardless of whether the break condition has already been met on a
previous or following page, *and* that block spans multiple pages, the
result is incorrect... It seems the methods in themselves are not the only
cause, but we should also look at the points where the breakValue is
computed.

I also tried two fo:blocks, first one with break-after="even-page" and the
second with break-before="even-page", and I don't know exactly what the
result is supposed to be, but IIC, if the first block ends on an odd page,
there should be three blank pages in between (?) Currently, the result is
exactly what you would expect if only one of the two break-* props had been
specified as 'page'.
Also, a break-before="page" on the very first block in the document seems to
be ignored. Is that correct behaviour?

Overall, there seems to be something wrong in this logic in
PSLM.needNewPage() :

if the current page is empty, then
  if the break-condition is 'page', then
    we don't need a new page
  else if the current page is odd, then
    we need a new page if the break-condition is 'even-page'
  else
    we need a new page if the break-condition is 'odd-page'
else
  we need a new page

So, bottom-line is that we can only need a new page

if the current one is not empty, or
if the current one is empty, but it isn't odd/even...

These tests should be combined in some other way, but I can't say which way
exactly. Maybe the breakValue should be extended to contain more info than
just PAGE/ODD/EVEN ...?
Seems like we also need to be able to answer the question:
"Did we end up on the current page as a result of a previous forced
break-after?"


Cheers,

Andreas