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.

2

5 Answers

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.

3

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.

I use two programs, PdfMod and JPdfBookmarks (see also this SourceForge page and the manual).

I found JPdfBookmarks to be superiour: for example, one can easily change the level of a nested bookmark, or exchange two bookmarks, which I was not able to do with the PdfMod.

SIMPLE to edit.
To edit the page number if the table of contents is leading to the wrong page: Open the edit tool in the pdf. Right click on the line you wish to edit. A menu will open ... if you have a link there, it will give you an edit link option ... click on it and the link properties opens. Select the actions tab where you can edit the page number. Keep in mind the labels on the pages may not be the same number if you started page 1 on other than the cover page.

If you only have text and no page link: Open the edit tool in the pdf. Select "Link" > "Add/Edit Web or Document Link" in the menu. Use the crosshair to select the area of text where you want to put the link... a "Create Link" should show once you have drawn the box area. Choose the Link Action "Go to a page view and hit "Next". A box "Create Go to View" should pop up. Scroll to the page you wish the link to go tov and draw a box around the area (full page or section). Choose button to "Set Link". Close the edit tool and try the link.

I find if I set the bookmarks up myself using the formula with switches in Word rather than trusting the automatic bookmarking, I have better control of the results in the conversion. I also make sure I export the Word using the Export>Create PDF/XPS document to better replicate Word with less conversion issues.

PDF is an image format. There is no storage of the contents of the table, only a "picture" of it. It can only be edited if the PDF's OCR can read the table as text, which is unlikely. You will need to use another application to create the table and then convert it to PDF.

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like