Re: page-sequence conditional-page-master-reference criteria for last odd page

Chris Bowditch <[email protected]> Wed, 12 Feb 2025 15:54:01 +0000
Newsgroups gmane.text.xml.fop.user
Message-ID <AS2PR08MB8430AE43B9131489586C4F88FBFC2@AS2PR08MB8430.eurprd08.prod.outlook.com>
Hi,

When you set force-page-count="end-on-even" the last page will never be 
odd and that's why the page master "last_odd" is never selected. What 
you are looking for is page-position="last-1" but unfortunately FOP 
doesn't support that

Thanks,

Chris

On 27/01/2025 20:41, Darryl Beallie wrote:
>
> Hi FOP users,
>
> I am having trouble with the page-master layouts used for a page 
> sequence.
>
> The page sequence uses force-page-count="end-on-even". This appears to 
> work as expected, no matter the content, the sequence always ends on 
> an even page, creating a blank if necessary.
>
> My trouble is with the last odd page when is preceding a forced 
> end-on-even page. I want for that preceding last odd page to use a 
> different footer layout.
>
> I have created simple-page-masters for even , odd , blank, and last 
> odd pages.
>
> I have created the page-sequence-master to use 
> repeatable-page-master-alternatives > 
> conditional-page-master-reference as follows
>
> <fo:conditional-page-master-reference master-reference="blank" 
> blank-or-not-blank="blank"/>
> <fo:conditional-page-master-reference master-reference="last_odd" 
> blank-or-not-blank="not-blank" page-position="last" odd-or-even="odd"/>
> <fo:conditional-page-master-reference master-reference="even" 
> blank-or-not-blank="not-blank" odd-or-even="even"/>
> <fo:conditional-page-master-reference master-reference="odd” 
> blank-or-not-blank="not-blank" odd-or-even="odd"/>
>
> No matter the order of the above conditional-page-master-reference 
> elements, the last_odd never gets selected.
>
> I have verified this by generating  “intermediate-format”  output and 
> see the if:page page-master-name="blank" correctly used for the last 
> page in sequence but the preceding odd page is using if:page 
> page-master-name="odd".
>
> <if:page-squence>
>
> <if:page page-master-name="odd">..</if:page>
>
> <if:page page-master-name="even">..</if:page>
>
> <if:page page-master-name="odd">..</if:page>
>
> <if:page page-master-name="blank">..</if:page>
>
> </if:page-squence>
>
> Am I misunderstanding  how force-page-count="end-on-even" works?  Or 
> do I have my conditional-page-master-ref criteria wrong or ordered 
> incorrectly?  Any help/ideas would be much appreciated.
>
> System details:
>
> Windows 11
>
> Oxygen 26
>
> JRE 17.0.8+7 (From Oxygen installed jre)
>
> Apache FOP 2.9  (From Oxygen installed fop)
>
> Thanks,
>
> Darryl
>