PDF BookmarksEdit online
The PDF Bookmarks are used to generate a hierarchical structure similar to a table of contents in a specialized view of your PDF Reader.
By default, the titles defined in the topics are used as bookmark labels.
PDF Bookmarks - Built-in CSSEdit online
The PDF bookmarks are generated by matching the titles from the topics in the content. The built-in CSS rules are in: [PLUGIN_DIR]/css/print/p-bookmarks.css.
How to Change the Bookmark Labels using the Navigation TitleEdit online
To change the bookmark labels, you can specify a navigation title in a DITA map or topic.
How to Control the Depth of the Sections From the PDF Bookmarks.Edit online
By default, the PDF bookmarks are generated for up to 7 levels. If you need to limit them (for example to 2 levels), you can use the following CSS rules in your customization CSS:
*[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"], *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"], *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"], *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"], *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] { bookmark-label:none; }
These rules clear the labels generated by the titles starting with the depth 3 (the topic
nesting level is given by the selectors *[class~="topic/topic"]).
How to Specify the Open/Closed PDF Bookmark StateEdit online
If you want to specify the initial state for the bookmarks (opened/expanded or
closed/collapsed), you can use the bookmark-state property in your customization CSS.
*[class~="topic/topic"] > *[class~="topic/title"], *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"], *[class~="topic/topic"] *[class~="topic/topic"] *[class~="topic/topic"] > *[class~="topic/title"] { bookmark-state:open; }
How to Remove the Numbering From the PDF BookmarksEdit online
By default, the PDF bookmark labels are generated while taking the text set before the chapters titles into account. Since this usually contains the part, chapter, or section numbers, the PDF Bookmarks will make use of them.
The solution is to remove the content(before) from the
bookmark-label, leaving just the content(text).
In your customization CSS, add the following CSS rules:
*[class~="topic/topic"] > *[class~="topic/title"] { bookmark-label: content(text); -ah-bookmark-label: content(); }
<title> element. Copy and modify the
built-in CSS for the full CSS rule that matches the <title> and
<titlealts>
elements:*[class~="topic/topic"]:has(*[class~="topic/titlealts"]) > *[class~="topic/title"] {...}