|
|
Thread Tools | Search this Thread |
12-23-2018, 05:01 AM | #1 |
Enthusiast
Posts: 45
Karma: 19864
Join Date: Sep 2018
Device: Kobo Clara HD
|
How to add a (e-reader compatible) Table of Contents to a PDF in Calibre?
The question is in the title. Please note that I am under Linux and thus do not have Adobe Acrobat Reader / the official PDF editor. My e-reader is a Kobo Clara, but I guess this information is not relevant.
I have tried to add entries to a table of contents from a quite usual PDF reader in Linux, which is evince, but this didn't work. So I ask myself if it is possible from within Calibre or one of its extensions... Do you know about that ? Thanks in advance ! |
12-23-2018, 07:23 AM | #2 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre does nothave any facility for editing PDF files I'm afraid.
|
12-31-2018, 09:41 AM | #3 |
Guru
Posts: 918
Karma: 417282
Join Date: Jun 2015
Device: kobo aura h2o, kobo forma
|
I have been using pdftk to add table of contents data to PDFs for a while. I have a few tools I wrote in perl that assist with formatting the data to make it suitable for pdftk.
Unfortunately, the hard part is generating the TOC itself. I have dreams of writing code to scrape the text TOC from inside the document and cleaning it up and helping the user verify the page numbers are right (by a combination of searching for page numbers on document pages and previewing the pages for the user)... However, right now, that's just a dream, and when I need it, I do it all by hand. Rarely I find documents that have a clickable internal TOC but no pdf toc. It might be possible to extract that data and convert it fairly easily, but I haven't looked into it yet. (If this is your situation, let me know, I might be motivated to work on that.) Calibre has a decent TOC editor that might be suitable to help with this, but unfortunately, that's the easy part. Inserting the TOC is also easy. The hard part is generating the TOC in the first place and verifying the page numbers are right. I have a large collection of PDFs that I don't even know if they have TOCs without going through each one and checking. Another dream is to write a calibre plugin to update metadata to indicate if a pdf needs a TOC. That's a lot easier; right now I've got my head buried in writing an unrelated calibre GUI plugin, so maybe the pdf toc detector will be next. Maybe after I've looked at calibre's pdf tools (rather than pdftk) I'll see if there's enough mechanism to write a TOC extractor or if I need to write an external tool. Last edited by compurandom; 12-31-2018 at 09:43 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any way to add to/edit table of contents for epub books? | bookw0rm | Calibre | 2 | 02-20-2017 11:50 AM |
How do I add a Table of Contents to a Kindle Previewer mobi? | Kratos | Kindle Formats | 22 | 09-24-2013 06:30 PM |
Creator How do I add a table of contents when using mobipocket creator? | Kratos | Kindle Formats | 24 | 06-20-2012 05:03 AM |
PRS-500 Can I add a table of contents to a given lrf file? | harpum | Sony Reader Dev Corner | 0 | 07-13-2007 08:36 PM |
PDF Table of Contents | Aerlock | Sony Reader | 0 | 01-12-2007 02:26 PM |