I'm using xhtmlrenderer (Also known as Flying Saucer) with iText to convert HTML to PDF. How would I create bookmarks with this? Does someone with have a small example?
Thanks in advance.
I'm using xhtmlrenderer (Also known as Flying Saucer) with iText to convert HTML to PDF. How would I create bookmarks with this? Does someone with have a small example?
Thanks in advance.
It seems bookmarks were added in R6, but the user guide only gives them a passing reference. with a TODO to the author to add an example later.
Searching the forums, I found this example:
So it seems that adding bookmarks is no more than declaring the bookmarks in the
<head>
and referencing them as anchors in the<body>
.This should work will with your existing XHTML->PDF conversion without requiring any code changes.
Its correct that above approach will work.
Sample example from flyingsaucer-R8-src modified for BookMarks Demonstration