View Single Post
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