04-30-2020, 02:25 PM | #1 |
Connoisseur
Posts: 56
Karma: 43090
Join Date: Jan 2013
Location: Sweden
Device: Cybook Odyssey HD Frontlight, Calibre, Macbook pro, OSX 10.6.8
|
Create a simple TOC, how?
Hi,
I would like to create a toc on a PDF (converted from DJVU). Just a simple one to jump to chapters in a 1000+ pages book. |
05-01-2020, 06:51 PM | #2 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Sorry. I'm sure that somebody, somewhere, has a faster/easier option, but the manual way is how I do it, when needed. I mean, realistically, there aren't a lot of PDFs, today, that come to life AS PDFs. As PDF is the end result of a process, most folks have the source docs, which facilitate making the links in a more-automated fashion. You, unfortunately, are stuck with the good old fashioned hand method. (I would note that searching for the word Chapter, if it's used, makes it slightly less excruciating. For the project you've previously mentioned, the pdfs from websites, well...it's all manual. Sorry.) Hitch |
|
05-01-2020, 10:23 PM | #3 |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Many many years ago I used jpdfbookmarks:
http://flavianopetrocchi.blogspot.co...marks-252.html Edit: I just looked up and saw that willus's fantastic tool, k2pdfopt also has an option "-toclist". This allows you to create a simple text file: Code:
1 Introduction 10 Chapter 1 +10 Chapter 1, Part A +25 Chapter 1, Part B ++25 Chapter 1, Part B, Subsection 1 ++27 Chapter 1, Part B, Subsection 2 +30 Chapter 1, Part C 50 Chapter 2 70 Chapter 3 You can read more details in his "List of Command-Line Options" (and check the above thread too, willus has tons of answers about his program there). Last edited by Tex2002ans; 05-02-2020 at 12:04 AM. |
05-02-2020, 12:15 AM | #4 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
05-02-2020, 07:50 AM | #5 | |
Fuzzball, the purple cat
Posts: 1,273
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
|
Quote:
To list existing bookmarks: cpdf -list-bookmarks input.pdf 0 "Part 1" 1 open 1 "Part 1A" 2 2 "Part 1B" 3 0 "Part 2" 4 1 "Part 2a" 5 I presume "open" is the bookmark you want the file to open to by default. To add bookmarks: cpdf -add-bookmarks bookmarks.txt input.pdf -o output.pdf |
|
05-02-2020, 07:39 PM | #6 | ||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
It's been at least 7 years since I had to add bookmarks to existing PDFs, so my info was probably a little out of date. Quote:
For example, Sigil formats the toc.ncx like: Spoiler:
Everything is already nested/indented in a certain way. So you strip everything besides <text> and playOrder: Code:
playOrder="1" <text>Part 1</text> playOrder="2" <text>Chapter 1</text> playOrder="3" <text>Part 2</text> Search: ^\s+playOrder="(\d+)"\r\n[ ]{8}<text>(.+)</text> Replace: 0 "\2" \1 Code:
0 "Part 1" 1 playOrder="2" <text>Chapter 1</text> 0 "Part 2" 3
Then you adjust the red part for "10 spaces" = next level: Search: ^\s+playOrder="(\d+)"\r\n[ ]{10}<text>(.+)</text> Replace: 1 "\2" \1 Code:
0 "Part 1" 1 1 "Chapter 1" 2 0 "Part 2" 3 Last edited by Tex2002ans; 05-02-2020 at 08:22 PM. |
||
05-05-2020, 08:26 AM | #7 | |
Groupie
Posts: 184
Karma: 2019866
Join Date: Feb 2018
Device: Kobo Aura-One (using KOReader app), Boox Note-3, iPad(s)
|
Quote:
Here is an older thread with some tools for the automatic and manual creation of a linked TOC, either as bookmarks or hyperlinked TOC page: https://www.mobileread.com/forums/sh...d.php?t=262659 Last edited by Marinolino; 05-05-2020 at 09:00 AM. |
|
05-05-2020, 09:07 AM | #8 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Unless I've misread this poster's threads, he is making pdfs from websites. Those aren't going to have preexisting TOCs with page numbers. @Tex2002ans: Yes, I suspect that's about the fastest way around it; create an ePUB, use headings (if they are not already there from the website), generate a TOC, etc. Hitch |
|
05-05-2020, 09:17 AM | #9 | |
Groupie
Posts: 184
Karma: 2019866
Join Date: Feb 2018
Device: Kobo Aura-One (using KOReader app), Boox Note-3, iPad(s)
|
Quote:
How to create an interactive (hyperlinked) table of contents with Acrobat. https://www.youtube.com/watch?v=IR7FT3Pr4a0 Last edited by Marinolino; 05-05-2020 at 09:37 AM. |
|
05-05-2020, 09:27 AM | #10 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
05-05-2020, 09:31 AM | #11 | |
Groupie
Posts: 184
Karma: 2019866
Join Date: Feb 2018
Device: Kobo Aura-One (using KOReader app), Boox Note-3, iPad(s)
|
Quote:
He can then use those numbers for hyperlinking the TOC page or for linking the bookmarks. Last edited by Marinolino; 05-05-2020 at 09:42 AM. |
|
05-05-2020, 11:21 AM | #12 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Why write down "page numbers" and then go through all the gyrations to build a TOC therewith? If he's got to page through the damned thing, to find the page numbers for the entries he wants, it's just as fast to add the links--hell, faster--than to write down the page numbers, add those to this hypothetical TOC and then run whatever CL program to add links to them. Right? I must be missing something in this thread. That, or I'm losing my mind. Not sure which, yet. Hitch |
|
05-05-2020, 11:21 AM | #13 | |
Groupie
Posts: 184
Karma: 2019866
Join Date: Feb 2018
Device: Kobo Aura-One (using KOReader app), Boox Note-3, iPad(s)
|
Quote:
https://www.softpedia.com/get/Office...DjVu-PDF.shtml Last edited by Marinolino; 05-05-2020 at 01:50 PM. |
|
05-05-2020, 03:54 PM | #14 |
Connoisseur
Posts: 56
Karma: 43090
Join Date: Jan 2013
Location: Sweden
Device: Cybook Odyssey HD Frontlight, Calibre, Macbook pro, OSX 10.6.8
|
Hi,
thanks for all the input! I have now managed to make a simple TOC through k2pdfopt. I extracted another books TOC and used it as a template. Then I copied my book table of content pages to a text document, compared the pdf document pages with the book page numbers, and adjusted the chapter page numbers according to this offset. This worked well as to understand how it can be done, and gave me a basic way to navigate the book on my e-reader. Since I do not have a workflow it was also very time consuming. If there is a tutorial or guide on a good workflow for making a toc it would be great to read it. I do not think hyperlinking will work well on my cybook hd frontlight. I am reading and converting from many sources: djvu, epub, pdf, and web content. Thanks! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ho do I create a TOC for ePub which does convert to an active TOC in Kindle Previewer | K-Thom | Calibre | 1 | 09-24-2013 06:32 PM |
How to Create a Simple Line Above & Below Paragraph? | msmith65 | Sigil | 8 | 08-24-2012 07:37 AM |
Creator Tearing my hair out trying to create a simple index | djb132 | Kindle Formats | 0 | 10-23-2011 10:14 PM |
PRS-500 Is there java lib to create simple LRF? | ns66 | Sony Reader Dev Corner | 20 | 08-13-2007 10:16 AM |