6

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.

  • Check this out. – new123456 Jul 17 '11 at 15:16
  • 1
    @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 superuser.com/a/915399 – Lekensteyn May 29 '16 at 10:03
4

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.

-4

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.

  • Not true. Check wikipedia en.wikipedia.org/wiki/Portable_Document_Format . What I want is to change the logical structure of the document. – fakedrake Jul 17 '11 at 9:04
  • 1
    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 '16 at 9:29

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.