Skip to content

Existing Bookmarks

Nemo edited this page May 28, 2021 · 2 revisions

The existing_bookmarks attribute lets you specify what happens to existing bookmarks in the individual PDF files. They can either be dropped (remove), kept as-is (keep), or flattened (flatten) as they are merged together. Care is taken to maintain hierarchy, but PDF is a tricky format and results might not always be perfect. The default value is remove as it generates the cleanest possible PDF.

Examples

An easier way is to showcase what happens with all the cases. Given a PDF with the following structure:

1.pdf

Chapter 1
Chapter 2
 Scene 1
 Scene 2

2.pdf

Chapter 3
Chapter 4
 Scene 3
 Scene 4

And the following input markdown file:

# Volume X

[Part 1](1.pdf)
[Part 2](2.pdf)

Will result in 3 different variants depending on the value of existing_bookmarks.

remove

The structure is identical to the input markdown:

Volume X
 Part 1
 Part 2

flatten

The inner bookmarks of the PDF are flattened and nested inside the last known bookmark.

Volume X
 Part 1
  Chapter 1
  Chapter 2
  Scene 1
  Scene 2
 Part 2
  Chapter 3
  Chapter 4
  Scene 3
  Scene 4

keep

Similar to flatten, but the nested structure of the individual PDFs is maintained.

Volume X
 Part 1
  Chapter 1
  Chapter 2
   Scene 1
   Scene 2
 Part 2
  Chapter 3
  Chapter 4
   Scene 3
   Scene 4
Clone this wiki locally