docbook-apps

Re: [docbook-apps] Detecting last page

  • 1.  Re: [docbook-apps] Detecting last page

    Posted 05-17-2012 23:13
    The XSL-FO standard and processors support page-position="last", but the DocBook
    stylesheets do not use it out of the box. This change would require some
    customization to add a simple-page-master and modifying the page-sequence-master to
    include it, something like this:

    <fo:page-sequence-master master-name="body-custom">
    <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference master-reference="body-first"
    page-position="first"/>
    <fo:conditional-page-master-reference master-reference="body-last"
    page-position="last"/>
    <fo:conditional-page-master-reference master-reference="body-odd"
    page-position="rest"
    odd-or-even="odd"/>
    <fo:conditional-page-master-reference master-reference="body-even"
    page-position="rest"
    odd-or-even="even"/>
    </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>

    I presume you want to put the legalnotice in the static content on that page, so its
    simple-page-master will need a larger bottom body margin and bottom extent. You'll
    need to name the bottom region differently, and then add a new fo:static-content to a
    custom version of the 'running.foot.mode' template. If you define that static content
    directly, you won't need to put the content in the 'footer.content' template.

    All this is a lot of trouble, of course. You might consider inserting an fo:footnote
    at the end of a custom template matching on article. That will still place the
    content at the bottom of the last page.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net