Scanned PDFs often lack a table of contents. Instead of buying expensive PDF software, use these Linux/Mac commands:

# Install pdftk (on Mac)
brew install pdftk-java
# Extract metadata
pdftk input.pdf dump_data_utf8 > metadata.txt

Open metadata.txt in your editor and add bookmark locations in this format:

BookmarkBegin
BookmarkTitle: Chapter 1
BookmarkLevel: 1
BookmarkPageNumber: 1
BookmarkBegin
BookmarkTitle: Chapter 2
BookmarkLevel: 1
BookmarkPageNumber: 10

Then apply the metadata to create a PDF with a table of contents:

# Apply edited metadata
pdftk input.pdf update_info_utf8 metadata.txt output output.pdf