Add index in pdf format

29 views
Skip to first unread message

Daniele Antonini

unread,
Jan 22, 2014, 8:49:28 AM1/22/14
to jooq...@googlegroups.com
Hi Lukas,

Can you add an index in pdf format, so that it can be navigated quickly even on mobile devices?

Cheers 
Daniele

Lukas Eder

unread,
Jan 22, 2014, 9:28:34 AM1/22/14
to jooq...@googlegroups.com
I suspect that by index you don't mean the table of contents, right? Because that already contains links. Can you show an example of what you mean? And if you know, how to do it with XSL-FO and Apache Fop?

Cheers
Lukas


2014/1/22 Daniele Antonini <antonini...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Daniele Antonini

unread,
Jan 23, 2014, 5:13:31 AM1/23/14
to jooq...@googlegroups.com

Hi Lukas,
Yes you're right I don't mean the table of content, and yes I've seen link between pages.

When I read other pdf on my tablet I can view index from within each page using a specific feature "show index".
This is very usefull because I can move between sections with no overhead.
With jooq pdf i must go to the index page at the beginning of book .. a bit frustrating for me.

The missing of the index can be noticed also with other program: evince for example (a linux program):
Once opened jooq pdf, press F9 to show the side bar, at top you can view a dropdown menù but I can't select index item.
When I open other pdf like https://github.s3.amazonaws.com/media/progit.en.pdf instead I can choose index.

I have no idea how to enable with XSL-FO/FOP but I can easily investigate a bit. 
Jooq documentation, and pdf auto generation, is available on github/jooq source code repository?

Cheers

You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/F7F3KSDLjKU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.

Lukas Eder

unread,
Jan 24, 2014, 5:08:24 AM1/24/14
to jooq...@googlegroups.com
Hi Daniele,

It is actually very very easy, and indeed very useful also on the desktop. I have registered and implemented #2976 (you may need to clear your browser cache):

Note, the technical term is bookmark-tree and bookmarks, not index (didn't know this, either). That's the XSL I needed to add:
<xsl:template match="section" mode="bookmark">
    <xsl:variable name="id" select="@id"/>

    <fo:bookmark internal-destination="{$id}">

        <!-- Hide all bookmarks except the top-level one -->
        <xsl:attribute name="starting-state">
            <xsl:choose>
                <xsl:when test=". = /manual/section">show</xsl:when>
                <xsl:otherwise>hide</xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>

        <fo:bookmark-title>
            <xsl:value-of select="title" />
        </fo:bookmark-title>

        <xsl:apply-templates select="sections/section" mode="bookmark"/>
    </fo:bookmark>
</xsl:template>
Gotta love XSL. It's probably my second-favourite tech right after SQL :-)
Thanks again for reporting

Cheers
Lukas


2014/1/23 Daniele Antonini <antonini...@gmail.com>
Reply all
Reply to author
Forward
0 new messages