kfxgen is a Calibre plugin that turns EPUB books into Amazon's KFX format, with a working Kindle table of contents.
What's new in 5.19.0
This release brings kfxgen's output in line with Kindle Previewer 4.0.3, Amazon's own converter.
- The parts of kfxgen never reviewed before were compared, piece by piece, with what Previewer writes for the same book.
- Every difference found was fixed or filed.
- The fixes were then checked on real Kindles: a Paperwhite (firmware 5.19.2) and a Voyage (5.13.6). All passed except one known gap.
What readers will notice
- Navigation:
- the contents pane keeps the book's chapter order;
- chapter skipping stops at the book's real headings;
- web and email links work;
- links land on the right word.
- Pictures:
- pictures are sized as Previewer sizes them, and very large ones are scaled down;
- pictures inside a line of text stay in the line;
- pictures saved in print colours show their true colours;
- a damaged picture no longer stops the conversion.
- Tables: cells are aligned as in Previewer, including right-to-left tables, and cell background colours show.
- Text: line spacing, hanging indents, quotation marks, and headings styled by the book all match the book's own styles.
- Library:
- the book's own description and every author carry over;
- the language is written correctly, so Japanese shows Japanese letter forms and look-ups use the right dictionary.
Tech debt paid down
- Audit: the code that had never had a review was audited against Amazon's own output.
- Dead code: code that could never run, and an old navigation fallback Amazon never uses, were removed.
- Duplicate data: each paragraph with a picture or equation now stores its words once, not twice, which also fixes an error some books reported.
- Failure reports: when the converter fails, the log says what went wrong and where, even if the fallback fails too.
- Safer saving:
- a failed save cleans up after itself;
- an overwritten book keeps its file permissions;
- the Kindle Previewer fallback checks what it needs before it starts.
- Speed: each picture is decoded once instead of twice.
- Tests: each fix's tests were checked by breaking the code on purpose, and tests were added where none failed.
Still open:
- A subscript inside a superscript is drawn raised (#536).
- Print page numbers and one table-of-contents link that Previewer adds are not written yet (#578, #579).
- Right-to-left page turning (#246) and vertical Japanese text (#247) are not supported.
The full list, with issue numbers, is in CHANGELOG.md.
Install (Calibre)
- Download kfxgen-plugin-5.19.0.zip from the Assets below.
- In Calibre, open Preferences → Plugins → Load plugin from file, and choose the zip.
- Restart Calibre.
Or from the command line:
calibre-customize -a kfxgen-plugin-5.19.0.zip
Then convert any book to KFX.