You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Perry Molendijk <xi...@iinet.net.au> on 2002/12/02 06:26:05 UTC

[patch] PDF Bookmarks - FOP Extension

Blank
 Hello,

I have added the FOP extension templates for building the PDF bookmarks to
common/document2fo.xsl in my Forrest install. It adds the bookmarks for the
top of the document and each section tag in the lefthand pane of Acrobat
Reader, very handy for larger documents.

download: http://members.iinet.net.au/~xions/dev/download/fo.zip

There are 2 files in the zip file:

document2fo.xsl
pdfoutline.xsl

save both to: skins\common\xslt\fo

pdfoutline.xsl is included in document2fo.xsl

Changes to document2fo.xsl:

added the line: <xsl:include href="pdfoutline.xsl"/>

added this line in the root template: <xsl:apply-templates
select="/document" mode="outline"/> after the </fo:layout-master-set>
closing tag.

added 'id="{generate-id()}' attribute to document template:
<fo:block padding-before="24pt" padding-after="24pt" font-size="24pt"
font-weight="bold" id="{generate-id()}">

added 'id="{generate-id()}' attribute to section template:
<fo:block font-family="serif" font-size="{$size}pt" font-weight="bold"
space-before="12pt" id="{generate-id()}">


That's it.

Perry Molendijk


Re: [patch] PDF Bookmarks - FOP Extension

Posted by Steven Noels <st...@outerthought.org>.
Perry Molendijk wrote:

> I have added the FOP extension templates for building the PDF bookmarks to
> common/document2fo.xsl in my Forrest install. It adds the bookmarks for the
> top of the document and each section tag in the lefthand pane of Acrobat
> Reader, very handy for larger documents.

Patched (manually, so please cross-check).

Thanks, Perry. Minor nit: next time, could you please create a patch, or 
at least not mess with the whitespaces: your file was using tabs instead 
of spaces, and had all infra-template whitespace collapsed, which made 
it difficult to apply it.

Thanks again,

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at              http://radio.weblogs.com/0103539/
stevenn at outerthought.org                stevenn at apache.org