View Single Post
Old 10-29-2021, 03:14 PM   #32
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
I'm attaching a PDF of a book with inserted highlights and notes to this post along with associated files to make it. It turns out that the utility html2ps does not choke on the XML in a rawml file like my web browser does, so there was no need to comment out the XML. What is also surprising to me is that the TOC in the PDF works. This is not meant to be a book with highlights and notes, but rather the highlights and notes shown in context.

The source book is EPUB of The Humbugs of the World by P T Barnum from the Mobileread Library. I used kindlegen to make a dual mobi and used kindleunpack to extract the rawml and azw3, which I copied to a kindle and quickly made 9 highlights with bogus notes.

Then I copied the azw3r and dumped the notes, which also gives the start and end of the each higlight. Next I used the notes_insert.pl from the first post to modify the rawml, then html2ps and ps2pdf. You can search the PDF for '[HL]' or '[Note:' to find the highlights and notes.
Hello,

I generate my AZW3 files by converting EPUBs using Calibre. Then I copy those over to the Kindle (Kindle Paperwhite IV), read and put in notes/highlights. Afterwards, I copy over the .sdr file (including .azw3r and .azw3f) to my computer.

I used your scripts from here:

https://github.com/jps-e/azw3r

in the following way:

1. Extract notes:

perl azw3r.pl -n -i <azw3r_file_path> > out.notes

2. Extract highlights:

perl azw3r.pl -h -i <azw3r_file_path> -r <dat_file_path> > out.highlights

I generated the DAT file by using KindleUnpack from here:

https://github.com/kevinhendricks/KindleUnpack

with this command:

python3 kindleunpack.py -d <azw3_file_path> out.dat

The dat file I used for -r parameter was taken from out.dat/mobi8/ -> assembled_text.dat

The step I don't understand how to do is generating the PDF file. Based on your comment, I should be able to use insert_notes.pl script for this, but I don't know how to call it so that it does this.

Can you help?

Thanks.
BlackWolf1994 is offline   Reply With Quote