3

How can I create a tree table of content in a PDF that can be expanded and collapse like the image below?

I know we can go to a page and add a bookmark to include that page in the table of content, but I cannot create a "tree" this way. In addition, if we create a table of contents in a Word document using styles, we can have a table of content by converting the Word into PDF, but I'm talking about a PDF created from scanned book images.

enter image description here

1

Jpdfbookmark can work for scanned books

Watch tutorial video ≫

Step 1: Prepare the table of content

Save the TOC in a .txt file in this format:

Chapter 1. The Beginning/23
    Para 1.1 Child of The Beginning/25,FitWidth,96
        Para 1.1.1 Child of Child of The Beginning/26,FitHeight,43
Chapter 2. The Continue/30,TopLeft,120,42
    Para 2.1 Child of The Beginning/32,FitPage

You can ORC the TOC and use regex to fix it.

Step 2: Load that TOC

Step 3: Prepare for step 4

This sounds dumb, but if you miss it you will be frustrated and have to do it again. Expand all bookmarks (Ctrl + E), select all of them, then go to Tools → Apply Page Offset

Step 4: Apply page offset

This step should be self-explained. Don’t forget to save.


That’s it. You are done. For more information, you can read its its manual. The program has command line mode and can work on Linux, Mac.

If there are non-Roman characters, be sure to use the same encoding when dumping and applying bookmarks.

I also have a complete guide to process scanned books, you may want to check it out: The ultimate guide to process scanned books.


FYI:
How to OCR tables of contents to proper outputs?
How can I split in half a double-page scanned PDF in a single pass?

  • Hi there, I'm another random guy! I appreciate it. – living being Oct 29 '17 at 7:19
  • Hi random guy, thanks for visiting my profile. Hope you like it – Ooker Oct 29 '17 at 11:50
0

If you do OCR, then you could use Aerialist by Debenu, an Acrobat plug-in, to create bookmarks.

In case OCR is not possible or does not provide satisfactory results, I don't see any other way than to create the bookmarks manually.

To manually create hierarchical bookmarks in Acrobat, you grab the bookmark for the lower level, move it over or just below the upper level bookmark entry and pull it towards the right. You will see an insertion line which is more indented than if it is on the same level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.