Hacker News new | past | comments | ask | show | jobs | submit login

I had no idea that an EPUB file was embedded in the weird Amazon formats.

I mostly agree that you want to avoid "transcoding" an EPUB. But the formatting on some official EPUBs is so bad that I like to use readers that can override the built-in formatting. I like to choose the font, spacing, hyphenation, and justification myself. (Full justification and hyphenation are my bugbears--I think they are never appropriate on smaller screens, as they lead to large rivers and too many words broken up, but are fine on large ones.)




There isn't an EPUB "embedded" in Kindle formats. The Kindle format is based on the pre-Kindle Mobipocket format (that's why unDRMed Kindle books often have an extension of .mobi). EPUB didn't even exist when this format was created. Making an EPUB (or any other format) from a Kindle book involves converting, which is always going to introduce changes in formatting. People can argue that one program or another does a better job at doing it, but there's no way around it.


That's partly correct. Quote from the KindleUnpack Github[1]:

- MobiPocket and early Kindle version 7 or less ebooks are unpacked to the original html 3.2 and images folder that can then be edited and reprocessed by MobiPocketCreator.

- Kindle Print Replica ebook are unpacked to the original PDF and any associated images.

- Kindle KF8 only ebooks (.azw3) are unpacked into an epub-like structure that may or may not be a fully valid epub depending on if a fully valid epub was originally provided to kindlegen as input. NOTE: The generated epub should be validated using an epub validator and should changes be needed, it should load properly into Sigil and Calibre either of which can be used to edit the result to create a fully valid epub.

- Newer Kindle ebooks which have both KF8 and older versions inside are unpacked into two different parts: the first being the older MobiPocket format ebook parts and the second being an epub-like structure that can be edited using Sigil

[1]: https://github.com/kevinhendricks/KindleUnpack


There's another layer to the format onion, even. The .mobi file, without DRM, is a PalmOS resource collection file https://en.wikipedia.org/wiki/PRC_(Palm_OS) since mobipocket


(I just looked and saw that I didn't finish that sentence: since mobipocket was primarily a PalmOS application at its peak.)


That's basically the case. The Amazon format is basically a proprietary wrapper around epub. You make a Kindle file by starting with an ePub file and running it through the Kindlegen software provided by Amazon. So Calibre's converters are basically reverse-engineering that process. This means that if an ePub version of the book is being sold by Apple or Kobo or some other vendor, that's the file you should start with, though their encryption may be better than Amazon's.


You could unpack the ePubs, edit the CSS and repack it; and then they would work with all readers.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: