Is there a command-line tool that can extract only the table of contents and bookmarks as metadata from a pdf?
I found the pdftk dump_data tool/command:
pdftk in.pdf dump_data output
It works but only for small files. Also, it seems to parse the entire file. I only want metadata about the table of contents and bookmarks.
mutool
from mupdf to decompress large pdf files. Your table of contents is probably just text, and what format your bookmarks are in really depends on the particular pdf, so you'll have to do some custom self-written parsing in any case. – dirkt Feb 20 '17 at 07:56