Jellicle
Jellicle

Reputation: 30226

How to extract text from .kdf files?

I'm working with a .kdf file (making a book for Kindle) and want to extract the text from it because I made changes to it and need to update my .doc file. How can I extract the text? An inspection of the file suggests that it is an SQLite database file:

head -c 15 book.kdf # => SQLite format 3

When I run sqlite3 book.kdf, I find no tables, though when I peruse the file with less I recognize parts of the text of the book, albeit in no format I understand.

Is there a way to extract the text?

Upvotes: 0

Views: 222

Answers (1)

Benjamin Manns
Benjamin Manns

Reputation: 9148

I was not able to figure out how to read the SQLite3 file inside the KPF file, but you may have another avenue if you generated the KPF from an ePub.

unzip mybook.kpf -d mybook/
cd mybook/
unzip book.epub -d book/
cd book/
ls *.xhtml

Those xhtml files should be your chapters/etc.

If you generated the KPF from an ePub, and it was stored in the KPF, then you should be able to extract your text from it.

I'm debugging a separate issue with a KPF, so hopefully I'll have more info on the SQLite file soon, but dumping, recovering, etc all did not work. If you look at the binary file, the text is in there, but inaccessible for whatever reason.

Upvotes: 0

Related Questions