docbook-apps

Expand all | Collapse all

Re: [docbook-apps] bookmark (left navigation pane) comes as expanded by default on PDF report docbook 1.74.3

  • 1.  Re: [docbook-apps] bookmark (left navigation pane) comes as expanded by default on PDF report docbook 1.74.3

    Posted 03-27-2009 18:30
    OK, FOP uses the fo:bookmark element to create bookmarks, and it supports the starting-state="hide" property, which hides the children of that bookmark (not that bookmark itself). To collapse all the top level elements in the bookmarks list, you'll need to customize this template from fo/fop1.xsl:

    <xsl:template match="set|book|part|reference|
    preface|chapter|appendix|article
    |glossary|bibliography|index|setindex
    |refentry
    |sect1|sect2|sect3|sect4|sect5|section"
    mode="fop1.outline">

    and change:

    <xsl:choose>
    <xsl:when test="self::index and $generate.index = 0"/>
    <xsl:when test="parent::*">
    ...

    to
    <xsl:choose>
    <xsl:when test="self::index and $generate.index = 0"/>
    <xsl:when test="self::chapter or self::appendix or self::preface">
    <fo:bookmark internal-destination="{$id}" starting-state="hide">
    <fo:bookmark-title>
    <xsl:value-of select="normalize-space(translate($bookmark-label, $a-dia, $a-asc))"/>
    </fo:bookmark-title>
    <xsl:apply-templates select="*" mode="fop1.outline"/>
    </fo:bookmark>
    </xsl:when>
    <xsl:when test="parent::*">
    ...

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: Bela Patel
    To: Bob Stayton
    Cc: docbook-apps@lists.oasis-open.org
    Sent: Friday, March 27, 2009 10:58 AM
    Subject: Re: [docbook-apps] bookmark (left navigation pane) comes as expanded by default on PDF report docbook 1.74.3


    yes,

    That is what I clarified in my second email. I misunderstood your question earlier.
    I am using FOP 0.95 as XSL-FO processor.

    Thanks,
    Bela.

    On Fri, Mar 27, 2009 at 1:46 PM, Bob Stayton <bobs@sagehill.net> wrote:

    Hi Bela,
    Actually, libxslt is the XSLT processor that generates the XSL-FO file from the DocBook XML source fie. The XSL-FO processor is used in the second step to convert the intermediate XSL-FO file to PDF. The list of XSL-FO processors includes FOP, XEP, Antenna House, and others.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: Bela Patel
    To: Bob Stayton
    Cc: docbook-apps@lists.oasis-open.org
    Sent: Friday, March 27, 2009 10:34 AM
    Subject: Re: [docbook-apps] bookmark (left navigation pane) comes as expanded by default on PDF report docbook 1.74.3


    I am using "libxslt-1.1.15.win32" (xsltproc) FO processor.

    Thnaks,
    Bela.

    On Fri, Mar 27, 2009 at 1:30 PM, Bob Stayton <bobs@sagehill.net> wrote:

    It depends on the FO processor. Which one are you using?

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: Bela Patel
    To: docbook-apps@lists.oasis-open.org
    Sent: Friday, March 27, 2009 10:10 AM
    Subject: [docbook-apps] bookmark (left navigation pane) comes as expanded by default on PDF report docbook 1.74.3


    Hi,

    I am using docbook version 1.74.3. to generate PDF reports.
    I have left navigation pane (bookmark) on the report.

    This left navigation pane shows all the section and chapter already expanded when the report is genereted.
    How can I make it to generete report so that all the sections comes as collapsed by default?

    Thanks,
    Bela.







  • 2.  RE: [docbook-apps] bookmark (left navigation pane) comes as expanded by default on PDF report docbook 1.74.3

    Posted 03-27-2009 18:41
    | -----Original Message-----
    | From: Bob Stayton
    |
    | OK, FOP uses the fo:bookmark element to create bookmarks,
    | and it supports the starting-state="hide" property, which
    | hides the children of that bookmark (not that bookmark
    | itself). To collapse all the top level elements in the
    | bookmarks list, you'll need to customize this template from
    | fo/fop1.xsl:


    I intend to create a general solution for this. The plan is to add a new
    parameter (bookmarks.starting.state) that specifies the initial state of the
    bookmarks (collapsed or expanded).

    See this feature request:
    https://sourceforge.net/support/tracker.php?aid=1792326

    Mauritz