Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Check this out. – new123456 Jul 17 '11 at 15:16
@new123456: had nothing about ToC editing – koniu Jul 20 '15 at 22:15
Perhaps PDFtk can be used to construct an outline (Table of Contents)? See step 3 of – Lekensteyn May 29 at 10:03

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.

share|improve this answer
Not true. Check wikipedia . What I want is to change the logical structure of the document. – fakedrake Jul 17 '11 at 9:04
PDF is not an image format. It's much more akin to HTML than to something like JPEG. – new123456 Jul 17 '11 at 15:15
Sorry. That is incorrect. There is no text or document coding in PDF "documents". The text is "read" by built-in optical character recognition software, just as text is read from any other image. Though it is far more complex in structure than, say, a jpeg, what you are looking at when you open a PDF is an image of a document. They are not really "documents" at all which is why they can't be directly converted to a document format, like .doc. They contain no document format information to convert. – Abraxas Jul 23 '11 at 9:36
Yes, as the article in Wikipedia points out, PDF's are complex. But they describe the way text is rendered, too, and notice that they use the word "drawn", unlike in other documents: "A text element specifies that characters should be drawn at certain positions." – Abraxas Jul 23 '11 at 9:47
This answer and your comment above is very inaccurate. The text is not OCRed, it is actually contained in the PDF file itself. When you open it with a text editor, you can see commands like /Length and stream. Objects with /FlateDecode can then be decompressed using zlib-flate -uncompress which will show text. I could for example recognize "Introduction" in [-1125(In)31(tro)-31(duction)] (generated by pdflatex). – Lekensteyn May 29 at 9:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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