Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 07-10-2022, 02:06 PM   #1
orebmur
Veteran Linux user
orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.
 
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
The resulting pdf file 'koreader-ug-with-toc.pdf' is attached to this post.

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.
Attached Thumbnails
Click image for larger version

Name:	koreader_toc_01.png
Views:	119
Size:	45.3 KB
ID:	194854   Click image for larger version

Name:	koreader_toc_02.png
Views:	106
Size:	47.3 KB
ID:	194855  
Attached Files
File Type: pdf koreader-ug-with-toc.pdf (2.61 MB, 369 views)
File Type: txt toc.txt (7.5 KB, 97 views)
orebmur is offline   Reply With Quote
Old 07-10-2022, 04:34 PM   #2
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
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 2: https://github.com/koreader/koreader/pull/5907

Edit 3: https://github.com/koreader/koreader/issues/9319

Last edited by Frenzie; 07-10-2022 at 04:44 PM.
Frenzie is offline   Reply With Quote
Advert
Old 07-11-2022, 11:32 AM   #3
orebmur
Veteran Linux user
orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.
 
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
Use any suitable text editor of choice to modify the bookmark data contained in the resulting file (admittedly, not for the faint of heart). Rejoin the results with PDF file as follows:

Code:
pdftk sample.pdf update_info output datadump.txt output corrected.pdf
PDFtk is availabel for free at www.pdflabs.com/tools/pdftk-the-pdf-toolkit

Last edited by orebmur; 07-11-2022 at 11:37 AM.
orebmur is offline   Reply With Quote
Old 07-11-2022, 01:02 PM   #4
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
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.
Frenzie is offline   Reply With Quote
Old 07-12-2022, 06:22 AM   #5
orebmur
Veteran Linux user
orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.orebmur ought to be getting tired of karma fortunes by now.
 
Posts: 150
Karma: 1000000
Join Date: Mar 2017
Location: Barcelona/Spain
Device: Boyue Likebook Note & Mimas, Hisense A5, hopefully soon a PineNote
Quote:
Originally Posted by Frenzie View Post
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.
Thanks for this pointer!
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.
orebmur is offline   Reply With Quote
Advert
Old 07-12-2022, 12:49 PM   #6
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,748
Karma: 730681
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by orebmur View Post
Thanks for this pointer!
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.
Ahh, pdftk is now a transitional package for pdftk-java. I hadn't realized that. Good to know.

In my defense, it was quite dead between 2013 and 2017 afaik.
Frenzie is offline   Reply With Quote
Old 07-13-2022, 04:58 AM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
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).
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 11:34 AM.


MobileRead.com is a privately owned, operated and funded community.