How can the Table of Contents in a PDF file be edited?

How can I edit the Table of Contents of a PDF file on Linux? I tried pdfedit but I can't find where the content table list is stored.


To edit bookmarks in PDF, I recommend the use of PdfMod which is also able to merge and split existing documents, remove, extract or rotate pages.


A very nice alternative is to use HandyOutliner, which works for PDF and DJVU. It also provides very good functionality for editing the table of contents.

Additionally there is the very handy python script called document-contents-extractor to extract contents from PDF's or DJVU's. It can be installed with pip (for me on Fedora pip3 install --user document-contents-extractor). It requires some additional dependencies to be installed as found in the instructions here.