View Single Post
Old 10-31-2021, 04:59 AM   #36
BlackWolf1994
Junior Member
BlackWolf1994 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2021
Device: Kindle Paperwhite
Quote:
Originally Posted by j.p.s View Post
Nobody asked before, and my instructions were incomplete.

It turns out that the output of azw3r.pl needs to be sorted. In addition, notes_insert.pl will not work correctly if both highlights and notes are in its input file.

So assuming the notes or highlights file has been sorted, the usage for notes_insert.pl is:
Code:
perl notes_insert.pl -r assembled_text.dat < notes.txt > annotated_book.html
ebook-convert annotated_book.html annotated_book.pdf
ebook-convert is the calibre ebook converter. I assume the calibre GUI would work as well.

Of course, you can use any file names you like for input and output files.
Amazing, that worked! I managed to generate separate PDFs with highlights and notes.

Big thanks!

Based on your comment, I gather that it is impossible to generate a single PDF file which would have both HLs and notes? I tried generating one of the HTMLs first and using it as input for the notes_insert script, but that doesn't work, it places the notes or highlights at wrong places, which makes sense since we added new text so the locations shifted. I have no other ideas. Would it maybe be possible to make it work if the input file has both HLs and Notes? Would that file have to include all HLs sorted followed by all Notes sorted or would it be a mix of HLs and Notes sorted?
BlackWolf1994 is offline   Reply With Quote