Skip to content

Use embedded PDF bookmarks in Flash trees - #384

Merged
rejojer merged 2 commits into
mainfrom
staging/flash
Aug 4, 2026
Merged

Use embedded PDF bookmarks in Flash trees#384
rejojer merged 2 commits into
mainfrom
staging/flash

Conversation

@rejojer

@rejojer rejojer commented Aug 4, 2026

Copy link
Copy Markdown
Member

PageIndex Flash now reads the PDF's embedded bookmarks (outline) and merges them into the extracted tree. No LLM involved; classification and merging are rule-based.

  • Trustworthy deep bookmark sets become the tree frame, and detected sections they lack are grafted back in by page range after noise filtering.
  • Coarse (chapter-level) sets become the chapter frame: detected nodes are re-hung under them, garbled extracted titles are repaired from the bookmark strings, and missing entries are filled in when the page text confirms them.
  • Junk sets (generic "Page 12" titles, file-name enumerations, non-monotonic targets) are ignored and detection stands alone.
  • On by default for page_index_flash / extract_toc; disable with use_embedded_toc=False or --no-embedded-toc. The result gains a toc_source key ("bookmarks", "hybrid", or "detected").
  • Bookmarks can also structure documents whose text layer is too poor for detection.

Title matching normalizes numbering notation (roman and arabic compare equal) and handles CJK titles.

@rejojer
rejojer merged commit 3c4c7e8 into main Aug 4, 2026
4 checks passed
@rejojer
rejojer deleted the staging/flash branch August 4, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant