PDF Bookmarks

PDF has a 'bookmark' feature for creating a hierarchical table of contents. By clicking a bookmark when viewing the PDF, you can jump to its target location. In CSS for paged media, bookmarks are created by adding -ah-outline-* properties to block-level elements. The level is specified by -ah-outline-level (1 being highest), titles are set with -ah-outline-title, and bookmarks can be organized using -ah-outline-group. These properties can be applied to any block-level HTML element like div, h1, p, etc.

Styling bookmarks

The style of a bookmark is independent of the style of the HTML it refers to.

Color

The -ah-outline-color property specifies the color of the bookmark title.

Font style

The -ah-outline-font-style property specifies the font style of the bookmark title. The allowed values are 'normal' and 'italic'.

Font weight

The -ah-outline-font-weight property specifies the font weight of the bookmark title. The allowed values are 'normal' and 'bold'.

Starting state

The -ah-outline-expand property specifies whether the bookmark subtree initially appears expanded or collapsed.

-ah-outline-expand: true"

-ah-outline-expand: true" specifies that the bookmark subtree is initially shown expanded. This is the default.

-ah-outline-expand: false

-ah-outline-expand: false specifies that the bookmark subtree is initially shown collapsed.