Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 12-04-2022, 05:47 PM   #1
code7
Junior Member
code7 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2022
Device: Kindle Paperwhite
opening ebook-viewer at the offsets that Kindle uses for exported annotations

Hello,

Is there a way to pass the offsets that Kindle uses for exported annotations as a CLI parameter to ebook-viewer, so that it opens at a given annotation?

I use Kindle Paperwhite + Calibre as a tool to upload books in azw3 format. I just leant that the annotations I make, while using Kindle, are stored in a separate file with azw3r extension and can be extracted from it.
I successfully used 2 methods:
The annotations are in a format

Code:
OFFSET_START  OFFSET_END  Note:   'annotation text'
e.g.
Code:
309905  309906  Note:   'my annotation'
565577  565581  Note:   'my second annotation'
I was super excited to discover that ebook-viewer supports --open-at parameter but I can't seem to find the format used by Amazon.
I'm not sure what exactly the offset represents. Maybe it could be converted to epubcfi somehow? Maybe there's another notation of the open-at argument that I should use.

I would like to store the notes outside of Kindle or Calibre and use deep-linking to the Calibre viewer.

Thank you in advance
code7 is offline   Reply With Quote
Old 12-04-2022, 10:00 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, there's no pre-existing code to convert offsets in amazon's formats to something more standard. The offsets refer to byte offsets in the internal binary representation of those formats.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-05-2022, 12:39 PM   #3
code7
Junior Member
code7 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2022
Device: Kindle Paperwhite
Thank you for the quick answer

Since ebook-viewer can read and render azw3, maybe there is a code there that I could re-use to at least extract the highlighted text between the binary offsets? (I'm a developer)
Are you aware of any other library that knows how to use those binary offsets?

This way I could use --open-at search:"EXTRACTED_SELECTED_TEXT"

I know it's not perfect but as long as the selected text is unique enough it would do the job.
code7 is offline   Reply With Quote
Old 12-05-2022, 01:24 PM   #4
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
You might want to check out these threads:

azw3r highlight and note extraction info

KRDS - A parser for Kindle reader data store files
jhowell is offline   Reply With Quote
Old 12-05-2022, 01:45 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Slightly
I would love a plugin that seeks the location of the annotations.
I use them on my reader to note errors. Being able to use GoTo Location in the Editor would be wonderful.
(And not just for Kindles. A whole series for the different devices. After all, what is the best way to PROOF? On the target device)
theducks is offline   Reply With Quote
Advert
Old 12-06-2022, 09:28 PM   #6
code7
Junior Member
code7 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2022
Device: Kindle Paperwhite
Quote:
Originally Posted by jhowell View Post
thanks so much jhowell
Reading through those threads helped me realize that azw3r tool has -r option, which should give me the original text. I tested it briefly. It didn't work for me yet but maybe I'm doing sth wrong.

Then I discovered the tool you wrote: KRDS. It worked like a charm. I followed your explanation to combine it with kindleunpack and this gave me the results I needed. The only remaining step in my project would have been filtering out formatting tags. Some of my annotations highlighted the text that had additional formatting.

At the end of the day, in one of the comments in the thread, I came across somebody recommending Kindle Mate. This software works for me out of the box, so I won't have to add any scripting for now. Otherwise I would build it on top of KRDS.

You guys did a fantastic job.

Thanks again
code7 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
eBook viewer not opening in Ubuntu 20 martinf Devices 5 03-01-2023 10:02 AM
Calibre ebook viewer not opening Inman Viewer 16 06-15-2022 10:29 PM
Problem opening ebook viewer MJLee Viewer 5 10-06-2020 07:02 AM
Annotations in Calibre Ebook Viewer jstash Calibre 1 05-22-2020 02:24 AM
Aura Annotations exported to the PC? Beniamina Kobo Reader 6 09-16-2017 10:22 AM


All times are GMT -4. The time now is 05:31 AM.


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