|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 25299999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
|
[Conversion Output] KFX Output
KFX Conversion Output Plugin
The purpose of the KFX Output plugin is to convert e-books into KFX files that can be sideloaded to newer Kindle apps and devices. This allows books obtained from sources other than Amazon to be read with Enhanced Typesetting, multi-thumbnail Page Flip, non-justified alignment, continuous scrolling, page curl, improved manga experience, and Guided View for comics. (Note: If you only want somewhat better typography when reading Kindle books then the Hyphenate This! plugin should be considered as an alternative to using KFX. It is less difficult to use and the book format it works with is compatible with more devices and software.) Background: Amazon has added support for several advanced features in newer kindle reading apps and firmware. Enhanced Typesetting allows improved rendering of e-book content using hyphenation, kerning and ligatures. Page Flip, improved manga experience (fast continuous page turns, pan/zoom, crop margins, page spreads), and Guided View for comics provide improved navigation within a book's contents. Only e-books in the proprietary KFX format support these features and currently only Amazon sourced e-books downloaded directly from Amazon to devices are available in this format. Amazon does not provide a way for Kindle users to convert their own books to KFX format. Amazon Kindle Previewer 3 is software that takes books in EPUB format and renders them with Enhanced Typesetting. It does this by converting the EPUB file to KPF, which has the same content as KFX but in a different container. This plugin is able to invoke the Previewer and reformat its output to produce KFX files suitable for sideloading. The plugin performs the following steps during conversion:
KFX books delivered by Amazon are a bundle of files composed of an encrypted main container, a metadata container, auxiliary containers (zero or more) and a DRM voucher. The plugin instead generates an equivalent unencrypted monolithic KFX file, which is supported by Amazon reading apps and devices when sideloaded. A more in-depth discussion of the KFX format can be found in the KFX Format thread and the MobileRead Wiki (KFX). KPF (Kindle Package Format) is a ZIP archive. The main components are a descriptive KCB file in JSON format and a KDF file containing the main book content in an SQLITE database. KPF can be produced by Kindle Previewer 3 (in unzipped form), Kindle Textbook Creator, and Kindle Create. Installation: The Amazon Kindle Previewer 3 should be installed in the default location under the same user account as is being used to run calibre. It is available from http://www.amazon.com/gp/feature.html/?docId=1003018611 for Windows and Mac. Version 3.29.1 (Jan 10, 2019) is recommended for best results. (Versions below 3.27 are not compatible with this plugin. Versions newer than 3.29.1 have not been tested and might not be compatible.) Install the KFX Output plugin and restart calibre as described in the Introduction to plugins thread. You can tell if the plugin/Previewer combination is functioning properly by attempting to convert a book that is known to work. One example is this edition of Frankenstein by Mary Shelley. Configuration: Configuration of the plugin is done in the KFX Output tab in the conversion options dialog. Defaults for future conversions can be set under Preferences, Output Options, KFX Output. These options are described in the Usage section. In addition "tweaks" can be configured to set some lesser used options that apply to all conversions. Set them by going to Preferences->Advanced->Tweaks->Plugin tweaks. Tweaks are entered as Python variable assignments. The "kfx_output_previewer_path" plugin tweak can be used to set the location where Kindle Previewer has been installed in cases where the default location was not used. (Windows paths require double backslashes.) For example: kfx_output_previewer_path = 'C:\\Program Files (x86)\\Kindle Previewer 3' A unique ASIN can be forced to be created during conversion even if an ASIN identifier or internal book metadata is present by setting the "kfx_output_ignore_asin_metadata" plugin tweak. kfx_output_ignore_asin_metadata = True Usage: The plugin is activated by selecting KFX as the output format when converting books in calibre. An alternative command line interface is available for advanced users. (See below.) By default the converted book will be marked as an Amazon purchased book. This enables the most features in Amazon reading apps and devices, but because the book was not actually purchased from Amazon unexpected behavior may sometimes result. The book can be marked as a personal document instead using the "Create personal document instead of book" conversion option. This may be of use if odd behavior is experienced. If the calibre book being converted has a 10-character mobi-asin, amazon, or asin identifier that starts with B then this will be used as the ASIN of the KFX file created. Otherwise a unique ASIN will be generated. A unique ASIN can be forced to be created even if an ASIN identifier or internal book metadata is present by setting the "kfx_output_ignore_asin_metadata" plugin tweak. A unique ASIN is also always generated for personal documents regardless of the identifiers present. Kindle Previewer 3 produces a lot of output during the conversion process, most of it useless. The plugin extracts error messages and shows them in the conversion job log. The full contents of the Previewer conversion logs can be saved by selecting "Show full Kindle Previewer conversion logs" in the conversion options. This might occasionally be useful in diagnosing a failure to convert a book. Page numbers contained in an NCX pageList, NAV page-list, or page-map.xml within the source EPUB will be converted. (The CLI must be used to preserve pages from a NAV page-list since calibre discards that during conversion.) Amazon APNX is not supported as a page number source. An option is available to create approximate page numbers in cases where page numbers are not present in the source format. The lookup name of a custom column holding the desired number of pages for each book may be specified, otherwise the page count will be determined automatically from the amount of book content. It is recommended that the "Tablet" output profile be selected in the Page setup section of conversion options to avoid having images downscaled by the calibre conversion pipeline. The resulting KFX file can be viewed using Kindle Previewer 3. However, the Previewer only supports the file extension ".azw8" for opening KFX files instead of ".kfx". As a workaround, "Open KFX with Kindle Previewer 3.bat" can be installed in Windows to allow files created by this plugin with a .kfx extension to be viewed more easily. (See this post for details.) KFX files created by the plugin must be sideloaded (transferred into the target device's storage). Calibre version 2.80 or later supports sideloading and viewing metadata for books in KFX format on connected Kindle devices. Calibre version 3.29 or later will also create cover thumbnails when KFX books are sent to a Kindle device. to sideload using calibre, you need to configure KFX as a format that can be sent to that device. With your device connected click on the "Device" drop-down menu and choose "Configure this device". Under "Select available formats and their order for this device", add a checkmark to "kfx" and use the arrow buttons move it up/down and set its priority relative to the other formats. Sideloading may also be done manually. The procedure for doing this varies by device type:
Showing Cover Thumbnail Images on E-Ink Kindle Devices: Spoiler:
Command Line Interface (CLI): Spoiler:
Converting Comics and Manga: Spoiler:
Dealing with Conversion Errors Spoiler:
Updating book metadata Spoiler:
Limitations: Spoiler:
Version History: Spoiler:
Last edited by jhowell; Yesterday at 09:13 AM. Reason: Version 1.28.0 |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 25299999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
|
Open KFX with Kindle Previewer 3
KFX files produced by the KFX Conversion Output plugin or imported using the KFX Input plugin can be viewed using Kindle Previewer 3. However, the Previewer supports the file extension .azw8 for opening KFX files instead of .kfx. In order to open a KFX file with the Previewer it must first be copied or renamed so that it has a .azw8 extension. The "Open KFX with Kindle Previewer 3.bat" script can be installed in Windows to allow files with a .kfx extension to be viewed more easily. Installation:
Once associated the script file will execute whenever .kfx files are to be opened. Usage: Once installed you can then select a converted book in calibre and in the "Formats" section of the book details panel and simply click on "KFX" to open it with the Previewer. The .kfx file will be copied to a temporary .azw8 file and opened with Kindle Preview 3. Limitations: This script uses a simple method to create the file type association, not the best possible method. A Command window will briefly pop up whenever the script is activated. It has only been tested under Windows 10. It is not available for MacOS or Linux. Version History: Spoiler:
Last edited by jhowell; 04-18-2018 at 09:30 AM. |
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 328
Karma: 2840782
Join Date: Jul 2014
Location: Australia
Device: Oasis 2, ONE, H2O, Voyage, HD, PW2, Aura, Glo, TRST3 (in that order!)
|
Thank you! You're a genius and inspire me to search and regain faith and trust in humanity. God bless!
... but what IS funny is that the okugin seems to have more success converting .kfx than the previewer itself! Go figure. Why is that?!? Last edited by cerem0ny; 03-28-2016 at 05:27 AM. |
|
|
|
|
|
#4 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 25299999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
|
Quote:
For example, the Previewer fails if the source EPUB does not have UTF-8 character encoding. The initial conversion step automatically converts other encodings to UTF-8. |
|
|
|
|
|
|
#5 |
|
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,166
Karma: 19853917
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Here's the log from my failed attempt:
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 25299999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
|
There isn't much I can tell from it. The Previewer's conversion routine, which runs under a Java installation included with the Previewer, somehow failed to launch. There is nothing in the log to indicate why. I can't tell if the problem is specific to Windows 7 or your particular PC.
I'll try to think of a way to have the plugin gather more information on this type of failure. In the mean time I have some questions to help diagnose the problem:
|
|
|
|
|
|
#7 |
|
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Mar 2016
Device: Kindle PW
|
Hi. I registered only for this.
First: thank you SO much for doing this! Sadly I tried using your plugin with the latest version of calibre and Kindle previewer 3 on my mac but i got an error message and the conversion failed. here is the log: http://pastebin.com/uUhqQWny I'm not using any antivirus that could interfere. It crashed with the Frankenstein book you linked. Later I tried to import the book in kindle previewer and got the "Enhanced Typesetting: Supported" message, so this seems to work. Thank you again for your work! Antonio Last edited by amordechai; 03-28-2016 at 04:18 PM. |
|
|
|
|
|
#8 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 25299999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
|
Quote:
I had to make some guesses about where files are located in the Mac version of the Previewer and I guessed wrong. I will have a new version of the plugin ready in a day or two that may fix the problem. Please post a new log if the new version of the plugin still fails for you. Thanks for your error report. |
|
|
|
|
|
|
#9 | |
|
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,166
Karma: 19853917
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Quote:
Then it asked me to update to 3.1, which I did. After that I ran the plugin again in calibre, and this time it told me that KindleImageConverter failed (twice, on one job). And then, on the next try, it converted the ebook which had failed 4 times already. So now it is working - sorta. |
|
|
|
|
|
|
#10 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Nov 2015
Device: kindle voyage, kindle paperwhite
|
How can I use the Amazon Kindle Previewer to convert from EPUB to KDF, when I open the EPUB via Kindle Previewer, it convert it to Mobi format. I have not seen any convert options to KDF.
|
|
|
|
|
|
#11 | |
|
Sir Penguin of Edinburgh
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,166
Karma: 19853917
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
Quote:
But to be clear, that "Mobi" file you just made isn't just a Mobi file. Did you notice how it is several times the size of the Epub you started with? That's because it actually contains several different ebooks, including the original Epub, Mobi, and the new KFX. |
|
|
|
|
|
|
#12 | |
|
Junior Member
![]() Posts: 7
Karma: 10
Join Date: Mar 2016
Device: Kindle PW
|
Quote:
Thanks for your work! |
|
|
|
|
|
|
#13 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 328
Karma: 2840782
Join Date: Jul 2014
Location: Australia
Device: Oasis 2, ONE, H2O, Voyage, HD, PW2, Aura, Glo, TRST3 (in that order!)
|
Wish I kept my Aura H2O! Can't remember any problems with the typography
but this conversion process is so hit and miss, it's annoying! Props for the plugin however
|
|
|
|
|
|
#14 |
|
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Mar 2016
Device: Voyage
|
Azw3
if you use the book "Azw3", you can convert the book in KFX always. Sorry for my English, I'm Italian.
|
|
|
|
|
|
#15 | ||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 25299999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
|
Quote:
I don't know why it functions inconsistently for you and presumably others. It may be due to a bug in the plugin, but since I can't duplicate the problem I am unable to diagnose it further at the moment. Quote:
After opening a book with the Kindle Previewer you will usually see a dialog box with the message "Your book successfully converted into Kindle format" with a link to a folder containing all of the MOBI files produced by the Previewer. This message is a bit misleading since it doesn't let you know whether or not allowing Enhanced Typesetting succeeded for that book. The Previewer generates a KDF file for each book, but only if it succeeds at converting it for Enhanced Typesetting. To tell if this was successful you need to check the book information screen using Ctrl-I or by selecting View->Book Information via the program menu. If this shows "Enhanced Typesetting: Supported" then a KDF file was produced. If it show "Not Supported" then it failed to produced the KDF. The KDF file will be in a recently created subdirectory of your TEMP directory. A different random subdirectory is used for each book. You need to locate the one created at the time that you opened your book in the Previewer. For example, on my Windows PC the TEMP directory is "C:\Users\John\AppData\Local\Temp" and I can find the most recently converted book within it named "145a-0754-be2f-1d6e\book\book.kdf". |
||
|
|
|
![]() |
| Tags |
| kfx, linux, wine |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Conversion Output] KePub Output Plugin | jgoguen | Plugins | 305 | 12-22-2018 10:44 AM |
| Conversion output plugins? | jgoguen | Development | 14 | 08-10-2013 12:19 PM |
| Output file name after conversion | dbellefuil | Calibre | 2 | 06-14-2013 05:40 PM |
| catalogue builder output columns are not in the same order in the output | KWhytte | Library Management | 5 | 12-04-2012 03:03 AM |
| Conversion output folders | TechieLady | Conversion | 6 | 01-19-2012 03:49 AM |