Hi Vincent,

I started to fool around a bit with the FOP source code and your suggestion: 

> I've just had a quick look and there seems to be almost nothing to do on the 
> layout side (which is good news). You just have to 
> go on l.111 of org.apache.fop.layoutmgr.PageBreaker (handleSpanChange method) 
> and replace the assignment appropriately. Instead 
> of:
>    needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL); 
> something like
>     needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL)
>            && childLC.nextHasFoxBalancingOption();
> Simply setting false already gave me the desirable result on a small example. 

Indeed, it worked on a small example, but a bigger example gave me an 
unexpected heart attack. If the wide block is in the first column, the result 
looks like I expected it, but then I had a wide block in the second column and 
instead of moving to the next page, I got balancing again:

<header>
AAA CCC
AAA CCC
AAA CCC
BBB
BBB
BBB 
DDDDDDD
DDDDDDD
DDDDDDD
<footer>

I guess, the next step is somewhere in Phase 3, but I've yet to understand the 
effect of needColumnBalancing there. Any hints? ;-)

P.S.: For those who don't read fop-user and don't know what I want to do: I 
have a two-column layout, but when a wide block (span=all) is encountered, I 
only want to fill one column above the block (on this page). Below the block 
both columns may be filled again.

Regards, 
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Vincent Hennebert [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 27. Oktober 2008 12:57
An: [EMAIL PROTECTED]
Betreff: Re: empty columns on multi-column-page

Hi Georg,

Georg Datterl wrote:
> Hello Vincent,
>  
>>> Well, most of the time even I would use the balancing algorithm, but not in 
>>> all cases. I guess I could implement a kind of fox-useBalancer="false" 
>>> for this cases, but even that would not make Block C (see below) possible.
> 
>> Well, I think it would. Basically the option would be "do not balance 
>> columns before a block that spans the whole page". So, on your 
>> example below, the bottom of page 1 is reached before block E is 
>> encountered, so columns are balanced. On page 2, block E is encountered so 
>> column balancing is disabled, then re-enabled after block E until the bottom 
>> of the page, etc. Actually this would be more efficient since there would be 
>> no need to re-typeset the content, in order to balance columns before a 
>> spanning block, as I believe it's done ATM. Might be a useful extension.
> 
> So it would be an extension for the page, not for the block. Either for 
> simple-page-master or (probably better) for region-body, if I understand you 
> correctly.

Oh, you're right actually, this can well be an extension for the spanning 
block. That would provide more flexibility since it would be possible to 
individually customize the behaviour. If the option were set on the region-body 
it would be the same for all spanning blocks.


> Do you think that's possible and how much work would it be? Mind, I'm 
> not asking you to implement it, but if you say it's possible and you 
> could do it in a day, I guess I might be able to do it in a reasonable 
> time (actually, not me, but a colleague of mine who actually knows his 
> way around the fop source code, I hope).

I've just had a quick look and there seems to be almost nothing to do on the 
layout side (which is good news). You just have to go on l.111 of 
org.apache.fop.layoutmgr.PageBreaker (handleSpanChange method) and replace the 
assignment appropriately. Instead of:
    needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL); 
something like
    needColumnBalancing = (childLC.getNextSpan() == Constants.EN_ALL)
            && childLC.nextHasFoxBalancingOption();

Simply setting false already gave me the desirable result on a small example. 
The difficulty is to make the necessary wiring in order to communicate the 
value of the option from the FO tree to the layout engine. I can't really help 
you on that matter, sorry, but you may want to have a look at how the 
fox:orphan-content-limit is implemented and do something similar:
http://xmlgraphics.apache.org/fop/trunk/extensions.html#widow-orphan-content-limit

If you decide to give it a go then switch to the fop-dev mailing list for any 
question:
http://xmlgraphics.apache.org/fop/dev/index.html#mail-fop-dev

<snip/>

Thanks,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to