View Single Post
Old 10-31-2021, 06:23 PM   #37
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,813
Karma: 103362673
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by BlackWolf1994 View Post
Amazing, that worked! I managed to generate separate PDFs with highlights and notes.

Big thanks!
You're welcome.

Quote:
Based on your comment, I gather that it is impossible to generate a single PDF file which would have both HLs and notes?
Impossible with the scripts as is. They might work if there is no overlap between notes and highlights, maybe by tweaking the location assigned to any note associated with a highlight.

Quote:
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?
The reason the notes and higlights files need to be sorted is that the insertion method is very simple and also minimizes memory requirements and code complexity. The scripts could run on a home computer from the 80's with less than 1 MB RAM for a book many megabytes in size. notes_insert.pl simply copies assembled_text.dat from the current position to just nefore the start of the next note or highlight, writes some formatting, a label, then any text to be inserted, some more formatting, then repeat for then next note or highlight.

They could be rewritten to do what you want by buildig a table of locations and shift sizes and use that to do the copying and inserting. That would be way too tedious and time comsuming for me to consider. For someone else, it might be a piece of cake to bang out or a challenge worth taking on.

The reason the thread title ends in "info" instead of "tool" and is in the Kindle Formats forum instead of the Kindle forum is that it's purpose is to provide information for others to pick up and take further without having to work out how to process azw3r files.
j.p.s is offline   Reply With Quote