Abhinav Agarwal
Abhinav Agarwal

Reputation: 11

How to write Xsl for creating bookmarks in a PDF file using Apache fop

I want to create a PDF using Apache fop . The requirement is that I want to create bookmarks in PDF using xsl fo stylesheets . Please provide me an example of how to achieve this .

Upvotes: 0

Views: 1421

Answers (2)

Tony Graham
Tony Graham

Reputation: 8068

Use the formatting objects for bookmarks defined in XSL 1.1. See https://www.w3.org/TR/xsl11/#d0e14206

FOP's conformance is shown at https://xmlgraphics.apache.org/fop/compliance.html#fo-object-bookmarks-section

There is sample FO and PDF at "PDF Bookmarks (<fo:bookmark-tree>, <fo:bookmark>)" in the "XSL-FO Samples Collection > PDF Features" at https://www.antennahouse.com/xsl-fo-samples#pdf

Upvotes: 2

Dominique Duvar
Dominique Duvar

Reputation: 21

<fo:bookmark-tree>
    <fo:bookmark internal-destination="B1">
        <fo:bookmark-title>Bookmark 1</fo:bookmark-title>
    </fo:bookmark>
</fo:bookmark-tree>



<fo:block id="B1">
...
</fo:block>

Upvotes: 2

Related Questions