I would like to know if it would be possible to have a bookmark stays highlighted for all of its sub-section.

Let's say this is my xslt code that produce 2 pages or more.

<fo:block id="something">
    //code
</fo:block>

If I produce my pdf with RenderX, the bookmark will only be highlighted for the first page which is supposed to be expected way of displaying a bookmark with adobe. But that's not what I want. I want my bookmark to stay grey for every element that would be in my block with the id="something".

By grey I mean this :

Grey bookmark

1

There are 1 best solutions below

1
On BEST ANSWER

I believe the answer should be "no" but if you have a sample PDF that does that, I would examine it for sure. First of all, bookmarks are GoTo operations to a specific location. Meaning I click one and it goes to a Destination in PDF (it could be in the current PDF or different PDF). They are totally disconnected from where you are in a document if you are navigating through the document and clicking around. There is no connection other than a simple go to this "spot", called a Destination in PDF.

The structure in the PDF standard for a Destination is straight forward, the first argument is a Page. It is not two pages, three pages, or anything of the like. It is a single Page (again either in the current document or another document). The other arguments can set the offset in the page, an area in a single page or such things as fit this page.

Thus, there is no connection to navigation in the PDF to the bookmarks. If that existed, I would expect applications that would auto-expand the bookmark list if I navigated in the document and clicked somewhere (assuming of course that was "within" a bookmark. There is also nothing that disallows creating 20 bookmarks to the same page, in your FO model certainly I could have something inside that block with another id. If I am inside that, what would be the active one? The answer is neither because only an anchor is created at the very start of that block and the Page and location of that spot is the Destination.

Adobe Reader does provide a "Find Current Bookmark" function and that function seems to navigate the PDF backward to find the first bookmark prior to your location and will expand the list to that item. But it is a function that executes only when you click it, it is not live. Now you could create your own customization to PDF reader that would execute that function on every click of the document. But that is as close as you can get.

That said, that does not even work properly in many cases. I just opened the PDF Reference, version 1.7 and went to Section 3.8.5 Name Trees by scrolling through the document. I clicked the function to "Go To Current Bookmark" and the bookmark tree expanded and highlighted 3.8.4 Rectangles. So even it was wrong.