Skip to main content

Bookmarks

The outlines object creates a document outline (also called bookmarks or a table of contents tree) that appears in the PDF viewer's navigation panel. Bookmarks link to specific pages and can be nested to represent document structure.

Properties​

PropertyTypeDescription
titlestringThe bookmark label displayed in the outline. Required, with non-space text; $data tokens and document-wide $global ones such as $global.TITLE resolve in it, as in the document's title
pageNumbernumberThe page the bookmark opens, from 1, shown whole in the window; a page the document does not have drops the entry and its children, reported. Absent, the bookmark is a folder for its children
childrenarrayBookmarks nested under this one

Automatic bookmarks​

Without outlines, the headings make the bookmarks when a table of contents has outlines: true (its default): each h1-h6 becomes an entry at its level, opening at the heading itself. A heading with "outline": false stays out of both the bookmarks and the table of contents. An authored outlines tree replaces the heading tree: the two are never mixed.

A document that claims PDF/UA-2 or a WTPDF level cannot carry authored bookmarks, since every destination must point into the structure tree: there, headings with a toc whose outlines is true make the bookmarks instead.

Examples​

Flat bookmark list​

{
"document": {
"outlines": {
"title": "Document",
"pageNumber": 1,
"children": [
{ "title": "Introduction", "pageNumber": 1 },
{ "title": "Financial Summary", "pageNumber": 2 },
{ "title": "Regional Breakdown", "pageNumber": 4 },
{ "title": "Appendix", "pageNumber": 8 }
]
},
"content": [
{ "p": "Introduction content..." }
]
}
}

Nested bookmarks​

{
"document": {
"outlines": {
"title": "Annual Report 2026",
"pageNumber": 1,
"children": [
{
"title": "Operations",
"pageNumber": 2,
"children": [
{ "title": "North America", "pageNumber": 2 },
{ "title": "Europe", "pageNumber": 3 },
{ "title": "Asia Pacific", "pageNumber": 4 }
]
},
{
"title": "Financials",
"pageNumber": 5,
"children": [
{ "title": "Revenue", "pageNumber": 5 },
{ "title": "Expenses", "pageNumber": 6 },
{ "title": "Projections", "pageNumber": 7 }
]
}
]
},
"content": [
{ "p": "Report content..." }
]
}
}

Where bookmarks appear​

Bookmarks are displayed in the PDF viewer's bookmarks/outline panel. In most viewers, click the bookmark icon in the left sidebar to expand the navigation tree. Each entry jumps to the target page when clicked.

When a document has bookmarks, the viewer opens with the bookmarks panel showing. To open on another panel, or to say so explicitly, set metadata.viewerPreferences.pageMode (see Links and navigation).

In a DOCX​

A DOCX carries no authored bookmark tree: outlines is reported, with each entry named, and left out. The headings keep their outline level, which Word's navigation pane and its own table of contents read.