This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: On creating PDF bookmarks
Jens Stavnstrup wrote:
> When creating FO files with the bookmarks function enabled. Everything
> appears to work after transforming the fo files to pdf with FP 0.20.3
>
> But, for some strange reasons all bookmarks to chapters/appendixes does
> not work, allthough bookmarks to sections works just fine. I also
> transformed the relevant example from the FOP 0.20.3 source distribution,
> where everythings work just fine.
>
> Comparing the fo file from my document with the fop example, I do not find
> any significant difference (except for for some extra blank lines in the
> fo example), and therefore suspect this to be a bug in FOP.
>
I have had the same question and took a deeper look into the generated
fo files. Docbook stylesheets assign the IDs (that are referenced
by the outline and the toc) for chapters etc. to the fo:page-sequence
element. But FOP does support some functionality (fox:outline,
fo:basic-link?, fo:page-number-citation) only for referenced fo:block
elements.
There are two possible solutions:
1. change/customize the stylesheets (assign id's only to fo:block),
2. patch/extend FOP.
I have done 1. as an example for the chapter element. Changes
would appear in fo/component.xsl (in the template that matches
chapter) and in fo/titlepage.templates.xsl (I know this file is
generated. For a clean solution template/titlepage.xsl have to be
changed. Possible? Is it worth a test?).
(Changes are documented at the end of this mail.)
My questions are now:
- What would be the right way: change docbook stylesheets or FOP?
- What say the xsl-fo specs (I know: RTFSpec :-). Maybe
someone else has done this before and can answer.)
- If we/I would customize the stylesheets, would this
cause side effects?
See above
> Does anybody have any similar experience with this ?
>
Yes
TIA and HTH, Sven.
----------------------------------
PS.: The changes
component.xls (line 201):
change <fo:page-sequence id="{$id}"
to <fo:page-sequence
titlepage.templates.xsl template "chapter.titlepage" (line 1161)
would look like this:
<xsl:template name="chapter.titlepage">
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" id="{$id}">
...
[snipped!!]