![]() |
#1 |
Veteran Linux user
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 150
Karma: 1000000
Join Date: Mar 2017
Location: Barcelona/Spain
Device: Boyue Likebook Note & Mimas, Hisense A5, hopefully soon a PineNote
|
Out of sequence entries break TOC
Just noted an unexpected behaviour for out of sequence TOC entries in koreader for Linux and Android.
Manually created a TOC (see attached toc.txt) for the new koreader user guide . In addition to the TOC entries made from the section headers, an additional custom tree named 'IMAGES' directly pointing to the pictures of the document was inserted. Following command was used to merge both the pdf and the TOC text file (in Linux): Code:
pdftk koreader-user-guide.pdf update_info bookmarks.txt output koreader-ug-with-toc.pdf As can be seen already on the attached screenshots, while the additional entries show the referenced pages within brackets, the actual redirection always points to the same page 1. This is reproducible for any koreader version on both amd64/arm64 Linux and Android/arm using a Boyue Note/Mimas. Using either xpdf or acroread-9.5.5 (via Wine) in Linux, the TOC display and jumping to the expected page works as expected. Expected behaviour for koreader TOC would be to function the same as the forementioned pdf readers. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,748
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
More directly relevant to us in the present, MuPDF 1.13 deals with it correctly.
![]() Edit: This seems to be by design; let's see why… Code:
07/10/22-22:37:07 DEBUG BOGUS TOC: 32 3 < 31 25 - 28 29 07/10/22-22:37:07 DEBUG fix prev 31 25 => 1 07/10/22-22:37:07 DEBUG fix prev 30 22 => 1 07/10/22-22:37:07 DEBUG fix prev 29 21 => 1 07/10/22-22:37:07 DEBUG fix prev 28 21 => 1 07/10/22-22:37:07 DEBUG fix prev 27 21 => 1 07/10/22-22:37:07 DEBUG fix prev 26 20 => 1 07/10/22-22:37:07 DEBUG fix prev 25 19 => 1 07/10/22-22:37:07 DEBUG fix prev 24 18 => 1 07/10/22-22:37:07 DEBUG fix prev 23 17 => 1 07/10/22-22:37:07 DEBUG fix prev 22 15 => 1 07/10/22-22:37:07 DEBUG fix prev 21 15 => 1 07/10/22-22:37:07 DEBUG fix prev 20 15 => 1 07/10/22-22:37:07 DEBUG fix prev 19 14 => 1 07/10/22-22:37:07 DEBUG fix prev 18 14 => 1 07/10/22-22:37:07 DEBUG fix prev 17 13 => 1 07/10/22-22:37:07 DEBUG fix prev 16 12 => 1 07/10/22-22:37:07 DEBUG fix prev 15 12 => 1 07/10/22-22:37:07 DEBUG fix prev 14 11 => 1 07/10/22-22:37:07 DEBUG fix prev 13 9 => 1 07/10/22-22:37:07 DEBUG fix prev 12 9 => 1 07/10/22-22:37:07 DEBUG fix prev 11 8 => 1 07/10/22-22:37:07 DEBUG fix prev 10 8 => 1 07/10/22-22:37:07 DEBUG fix prev 9 7 => 1 07/10/22-22:37:07 DEBUG fix prev 8 7 => 1 07/10/22-22:37:07 DEBUG fix prev 7 6 => 1 07/10/22-22:37:07 DEBUG fix prev 6 5 => 1 07/10/22-22:37:07 DEBUG fix prev 5 5 => 1 07/10/22-22:37:07 DEBUG fix prev 4 5 => 1 Edit 3: https://github.com/koreader/koreader/issues/9319 Last edited by Frenzie; 07-10-2022 at 04:44 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Veteran Linux user
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 150
Karma: 1000000
Join Date: Mar 2017
Location: Barcelona/Spain
Device: Boyue Likebook Note & Mimas, Hisense A5, hopefully soon a PineNote
|
Wow, this was taken care of really fast!
![]() Guess i'll then have to work around this koreader quirk regarding nested TOC's by fixing them manually whenever (rarely!) i happen to stumble over any book PDF with this "feature"... For the curious: Using pdftk, the table of contents (aka bookmarks) can easily be extracted with following command: Code:
pdftk sample.pdf dump_data output datadump.txt Code:
pdftk sample.pdf update_info output datadump.txt output corrected.pdf Last edited by orebmur; 07-11-2022 at 11:37 AM. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,748
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
I also like https://github.com/hellerbarde/stapler btw. Particularly since pdftk isn't really updated anymore afaik, though of course it's still useful for the moment.
|
![]() |
![]() |
![]() |
#5 | |
Veteran Linux user
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 150
Karma: 1000000
Join Date: Mar 2017
Location: Barcelona/Spain
Device: Boyue Likebook Note & Mimas, Hisense A5, hopefully soon a PineNote
|
Quote:
In Debian Linux, the upstream pdftk has been replaced by gitlab.com/pdftk-java/pdftk, an enhanced(?) reimplementation of the original pdftk, and which is in fact what i use. Good to know there are even more options. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,748
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
Quote:
In my defense, it was quite dead between 2013 and 2017 afaik. ![]() |
|
![]() |
![]() |
![]() |
#7 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I've been using qpdf as a replacement to pdftk, but I'm not sure it has this particular feature (and the syntax is hideous, I don't think I'll ever understand it).
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mobi TOC extra entries | DiogenesofMayber | Kindle Formats | 0 | 05-11-2020 09:20 AM |
AZW3 - not able to browse TOC entries | 1v4n0 | Kindle Formats | 6 | 06-07-2018 03:18 PM |
Page break and TOC entries | John123 | Workshop | 4 | 05-14-2013 04:26 AM |
TOC Entries from PDF | HamsterRage | Calibre | 2 | 07-12-2010 11:57 AM |