Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-26-2016, 01:42 PM   #1
jhowell
Wizard
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: 1,784
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
[Conversion Output Plugin] 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, improved manga experience, and Guided View for comics.

(Note: If you desire 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:
  • Convert from the original e-book format to EPUB.
  • Correct some common EPUB content issues that cause problems for the Previewer.
  • Use the Amazon Kindle Previewer to convert from EPUB to KPF.
  • Repackage the KPF data into a KFX container.

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 must 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.16 (Nov 9, 2017) is recommended for best results. (Versions below 3.13 are not compatible with this plugin. Versions newer than 3.16 have not been tested and might not be compatible.)

Install the 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.


Usage:

The plugin is activated by selecting KFX as the output format when converting books in calibre. 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.

An alternative command line interface is available for advanced users. (See below.)

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 the book will be marked as a "personal document" and a unique ASIN will be generated. This behavior can be overridden by selecting "Always create book instead of personal document" in the conversion options. (Warning: Books created using this option may cause unexpected behavior in some Kindle reading apps.)

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 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.0 or later supports sideloading and viewing metadata for books in KFX format on connected Kindle devices.

Sideloading may also be done manually. The procedure for doing this varies by device type:
  • Kindle e-ink devices: Instructions
  • Amazon Fire tablets: Instructions (KFX files must be marked as ebook instead of personal document and placed in the Books folder of Internal Storage.)
  • Kindle for iOS app: See "Copy files from your computer to your iOS app"
  • Kindle for Android app: Copy the file to the kindle or Books folder within main internal storage of the device (/sdcard).


Showing Cover Thumbnail Images on E-Ink Kindle Devices:
Spoiler:

Kindle apps will show sideloaded KFX book covers in the thumbnail view, but e-ink Kindle devices will only show a generic thumbnail. This can be corrected either by setting an ASIN corresponding to an equivalent book sold by Amazon before converting the book or by adding the thumbnail image to the device after the book is sideloaded.

If the proper ASIN is set before conversion then the e-ink Kindle device will automatically download the corresponding cover thumbnail image from Amazon's servers when the book is sideloaded. In order to do this:
  • Search amazon.com with a web browser for an Amazon Kindle book equivalent to the book you are converting and bring up its page. The Amazon web page must be for a Kindle-edition, a print edition will not work. If there is no equivalent book this procedure will not work. (If your Kindle is registered with an account at a country-specific Amazon site, such as amazon.co.uk, then you must use ASINs from the same site. Each Amazon web site uses its own ASINs.)
  • The web browser address bar will have something like "https://www.amazon.com/gp/product/B005MZN2B2/...". The ASIN (Amazon Standard Identification Number) for the book is the 10-character string that begins with a "B".
  • In calibre select your book, choose "Edit Metadata", and in the "Ids:" field add "amazon:B005MZN2B2" (without the quotes and using the ASIN you discovered). If there is something already in the "Ids:" field then separate the new information with a comma.
  • You can verify that the ASIN is set correctly by selecting the book in calibre and looking at the book details panel (usually on the far right). There should be an "Amazon.com" entry in the "Ids:" section. Click on "Amazon.com" there and your browser will open to the associated web page. Verify that the browser shows the expected book and that it is a Kindle edition, not a print edition. Use "Edit Metadata" to fix the ASIN if not.
  • Convert the book to KFX and sideload it to your kindle device.
  • After you eject your Kindle from your computer the cover thumbnail will be automatically downloaded from Amazon's servers. It should then show a cover thumbnail for the book. (Your Kindle will need to have a Wi-Fi or 3G connection for this to work properly.)

As an alternative to setting an ASIN, the ExtractCoverThumbs program can extract cover images from e-books files on e-ink Kindle devices and create and load the proper thumbnails. Support for KFX was added in ExtractCoverThumbs version 1.0.0. (Latest release, MobileRead thread)

Warning: Starting with kindle firmware version 5.8.5 cover thumbnails are no longer supported for personal documents, even if sideloaded using ExtractCoverThumbs. To work around this problem, use the "Always create book instead of personal document" conversion option. (The tweak previously used for this purpose is no longer supported.)



Command Line Interface:
Spoiler:

The KFX Output plugin has a command line interface for advanced users.

Code:
usage: calibre-debug -r "KFX Output" -- [-h] [-a ASIN] [-b] [-c]
                                        infile [outfile]

Convert e-book to KFX format.

positional arguments:
  infile                Pathname of the LAST, EPUB, OPF, MOBI, DOC, DOCX or
                        KPF file to be converted to KFX.
  outfile               Optional pathname of the resulting KFX file.

optional arguments:
  -h, --help            show this help message and exit
  -a ASIN, --asin ASIN  Optional ASIN to assign to the book.
  -b, --book            Force create book (EBOK) instead of personal document (PDOC).
  -c, --clean           Save the input file cleaned for conversion to KFX.
  -p, --pages           Create approximate page numbers if missing from input file.

Conversion of the Most Recent Book from the Kindle Previewer GUI

If the infile name ends with a ".last" extension it signals the plugin to locate the most recent file converted by the Kindle Previewer GUI and use that as the source for conversion to KFX. (A file should not actually exist with this name. The ".last" extension is simply used to activate this function.)

This is useful in cases where the plugin fails to function properly within the calibre GUI.

Examples:
Code:
calibre-debug -r "KFX Output" -- anyname.last output.kfx  (Converts most recent book to output.kfx)
calibre-debug -r "KFX Output" -- "my book.last"           (Produces my book.kfx)
Follow these steps to use this function:
  • Open a book using the Kindle Previewer GUI. The Previewer should show a dialog box with "Please wait while Kindle Previewer converts your book into Kindle format" followed by another dialog box with "Your book is successfully converted into Kindle format".
  • If the book opens without showing these dialogs then the Previewer is using a cached copy of the book instead of converting it. In this case, delete the contents of the "My Kindle Books" folder and open the book again in order to force conversion to occur.
  • Verify that the Previewer shows shows "Enhanced Typesetting: Supported" on the book information screen. This is displayed using Ctrl-I or by selecting View->Book Information via the program menu. If it shows "Not Supported", you will be unable to convert that book to KFX.
  • Invoke the plugin from a command prompt. For example:
    calibre-debug -r "KFX Output" -- Frankenstein.last


Conversion from EPUB or Word Document

If an EPUB file is used as the infile it will be passed to the Amazon Kindle Previewer for conversion to KPF and then the result will be repackaged as KFX. This bypasses any manipulation of the EPUB by the calibre conversion pipeline. English language MS Word DOC and DOCX files and MOBI files (created using kindlegen version 2.9 without the -dont_append_source option) can also be converted the same way.

Examples:
Code:
calibre-debug -r "KFX Output" -- input.epub output.kfx  (Converts input.epub to output.kfx)
calibre-debug -r "KFX Output" -- "my book.epub"         (Produces my book.kfx)
An unzipped EPUB can also be converted by passing the OPF file as input. In that case the OPF is passed directly to the Kindle Previewer for conversion without any fix ups being done.


Conversion from KPF

If a KPF file is used as the infile it is repackaged as KFX. This can be used to convert books produced using Amazon Kindle Create.



Converting Comics and Manga:
Spoiler:

The plugin is able to convert fixed layout comics and manga, however there are a number of limitations and restrictions.

Comics must be formatted as per the Amazon Kindle Publishing Guidelines for conversion to KFX. The source file may be unzipped (OPF) or zipped (EPUB). CBR and CBZ files cannot be used.

Files produced by Amazon's Kindle Comic Creator can usually be converted to KFX. Source files for conversion can be extracted from comics in MOBI or KF8 format using Kindle Unpack, though they may require some editing for successful conversion.

The files produced by Kindle Comic Converter are not currently compatible. (A development version exists with an output profile compatible with this plugin.)

The plugin's command line interface must be used to convert comics. (Using the calibre GUI will produce destructive changes to the source file that will prevent conversion.)

For example, if the root source file of the comic is named mycomicbook.opf it can be converted to KFX using the following command:

Code:
calibre-debug -r "KFX Output" -- mycomicbook.opf

Additional comic/manga limitations:

KFX comics sideloaded to an e-ink Kindle display in manga mode, even if they are not manga. Panel view does not function. Conversely, manga mode does not function in the Android or iOS Kindle app, but comics with panels display using Guided View. Other problems may occur if the Kindle is not running the latest firmware.

The plugin produces each comic as a single KFX file that may sometimes be too large for Kindles to handle. This can cause lock up and return to home screen during reading.

Images quality is sometimes reduced by the conversion process.

See "Dealing with Conversion Errors" for descriptions of some errors that can occur during comic conversion.



Dealing with Conversion Errors
Spoiler:

The plugin corrects some issues in the source EPUB that prevent conversion by Previewer: non-UTF8 character encoding, obfuscated fonts, language "UND", missing/duplicated title, and a few others. But many potential problems cannot be fixed automatically.

The Previewer often fails when something unexpected is encountered in the contents of the source EPUB. Some examples of things that may cause a conversion failure are:
  • Incorrect HTML or CSS files. (The calibre editor can often be used to detect and correct these problems. EPUBs can be validated using EpubCheck.)
  • Large tables and tables containing captions.
  • Incorrect or unusual style properties or values.
  • SVG graphics and images with internal errors.
  • Comics and manga that do not follow the Amazon Kindle Publishing Guidelines.
  • Miscellaneous things that trigger bugs in the Previewer software.

If a conversion error occurs the plugin attempts to capture the most relevant error message from temporary log files produced by the Previewer. When this occurs an error dialog box will pop up in calibre. The error messages produced are sometimes cryptic, but better than nothing.

Starting with version 3.15 Kindle Previewer provides guidance to help with fixing problems that can prevent conversion to KFX or produce incorrect conversion results. This information will be shown in conversion job log. In some cases additional guidance will be added by the plugin.

You can view the conversion job log after an error occurs to see additional information on why the conversion failed. To access the log, either click on the "Jobs: 0" label in the lower right corner of the calibre window or use the Alt-Shift-J keyboard shortcut to activate the Jobs dialog. Select the failed conversion job from the list (the most recent will be first) and click the "Show job details" button. To copy the log to the clipboard under Windows, click within the log text then press Ctrl-A (select all) and Ctrl-C (copy). You can then paste it wherever you like.

When Previewer errors occur it can be a tedious trial-and-error process to get a book to convert to KFX. One procedure is to use the calibre editor to selectively remove pieces of the source book until conversion is successful. This will narrow down what part of the book is causing the Previewer failure.

If a conversion fails and you feel that it may be caused by a problem with the plugin itself, rather than the Kindle Previewer, please report it in this thread along with the associated error message and log. If posting log contents please enclose them in [spoiler]...[/spoiler] tags.



Updating book metadata
Spoiler:

The metadata and cover images in KFX files produced by this plugin can be updated by a Metadata Writer Plugin that is built into this plugin. This is activated in calibre using the "Embed metadata" function, "Save to disk" function (with the "Update metadata in saved copies" option enabled), "Send to device", or by the "calibredb embed_metadata" command line interface. Metadata plugboards can be used. (The "Polish books" function will not update KFX metadata since it supports only the AZW3 and EPUB formats.)

The supported fields are: title, author, language, publisher, publication date, description, cover, and ASIN (from "mobi-asin", "amazon", or "asin" identifier).

Only the first author name is used by the Previewer when converting to KFX, however updating KFX metadata supports multiple author names. Each author name will be individually converted to sorted form. (The author_sort field is not used.)

Updating of KFX metadata can be disabled by disabling the "Set KFX metadata" plugin in the "Metadata writer plugins" category of plugin preferences.



Limitations:
Spoiler:

The KFX format is undocumented. This plugin might sometimes produce incorrectly structured KFX files that could cause a slowdown or crash of your Kindle device or app when sideloaded. Use at your own risk!

Many books cannot be successfully converted to KFX using the Kindle Previewer.

KFX files cannot be sent using Send to Kindle by E-mail or using Send to Kindle for PC/Mac.

KFX files produced by this plugin are uncompressed and so will usually be larger than other e-book formats. (KFX files for books purchased from Amazon include data compression in conjunction with their DRM.)

The X-Ray and Vocabulary Builder features are not currently available with sideloaded KFX books. (Books in KFX format can make use of X-Ray if they are marked as books instead of personal documents, but there is currently no X-Ray file creator that works with KFX format.)

Books converted by the plugin may not function properly in all devices and firmware versions. KFX has been extended over time. Amazon checks capabilities and only delivers KFX format if the device supports all of the features used within the book. Sideloading bypasses this check and may lead to incorrect book rendering. Because of this, the use of the most recent firmware and app versions is recommended for reading books in KFX format. Firmware version 5.6.5 or later is required for Kindle devices. Some e-book features, such as HTML tables and Page Flip, require firmware 5.7.2 or later. Firmware 5.8.5 or later is required for manga.

It is unknown whether or not the Kindle Previewer will function under Linux/Wine. This plugin does not currently support that environment.

This plugin requires calibre version 2.0.0 or later. Calibre version 2.80.0 or later is required for the automatic sideloading of KFX format to Kindle devices and viewing of metadata for sideloaded KFX files.

The Metadata Writer can replace an existing cover in a KFX book, but cannot create a new cover in a book that does not already have one.


Version History:
Spoiler:


Version 1.13.0 - 22 Nov 2017

Allow the optional creation of approximate page numbers in cases where real page numbers are not present in the source file of the book.

Added a Metadata Writer Plugin to allow the metadata and cover of existing KFX books to be updated.

Allow an EPUB file that has been cleaned of some potential problems to be saved using the CLI.

Fix occasional non-working links in the table of contents of books converted from AZW3 format.

Possible fix for reported conversion error: "Kindle Previewer error: Error(YJEpubAdapter):E00601: Internal error occured. java.lang.UnsatisfiedLinkError: ...\\shared.dll: Can't find dependent libraries"

Version 1.12.1 - 02 Nov 2017

Attempt to prevent error in Preferences -> Output Options.

Version 1.12.0 - 18 Oct 2017

Show conversion guidance produced by the Kindle Previewer and allow conversion of Arabic and Japanese language books when running Mac OS. (Accidentally left out of previous release.)

Added error logging to help detect the cause of Kindle Previewer failures.

Version 1.11.0 - 16 Oct 2017

Change the ".last" CLI function to work with recent Previewer versions. (Fixes error: "No Kindle Previewer KDF database file found. No conversion results are available.")

Remove the "kfx_output_force_cde_type_ebok" plugin tweak. This feature is now supported through plugin configuration.

List features and metadata of the KFX book in the conversion job log.

Show conversion guidance produced by the Kindle Previewer in the conversion job log. (Previewer version 3.15 or later is required.)

The full conversion log from the Kindle Previewer will no longer be included in the conversion job log. This can be overridden through plugin configuration.

Allow Arabic language books to be converted. (Previewer version 3.14 or later is required. Support for Arabic in Kindle apps/devices is currently incomplete.)

Allow Japanese language books to be converted. (Previewer version 3.15 or later is required. Only horizontal text is supported in Previewer 3.15.)

Handle some additional EPUB problems that would otherwise cause the Previewer to fail. (order of language declarations, incorrectly coded horizontal ellipsis entity)

Version 1.10.0 - 30 Aug 2017

Adjustments to output format to better match KFX files currently produced by Amazon. (Reading these files with the latest Kindle firmware/app version is recommended for best results.)

Fix occasional error during conversion: "TypeError: info() takes exactly 2 arguments (3 given)"

Attempt to work around occasional error during conversion caused by unexpected data produced by the Previewer: "yj.eidhash_eid_section_map has extra: ..."

Version 1.9.0 - 09 Aug 2017

Remove support for Previewer versions older than 3.13.

Allow English language MS Word DOC and DOCX files and MOBI files (created using kindlegen version 2.9 without the -dont_append_source option) to be converted to KFX using the Command Line Interface.

Allow Chinese language books to be converted.

Improve performance when converting large and complex books.

Improve reporting of conversion errors. Do not truncate (tail) Previewer conversion logs in the calibre conversion job log.

Handle more EPUB problems that would otherwise cause the Previewer to fail. (badly sized transparent GIFs, "onload" attribute)

Further internal changes based on the Amazon Ion specifications.

Version 1.8.1 - 31 Jul 2017

Remove the conversion time limit set by the plugin so that larger books can be converted. (A time limit can sill be set in calibre using Preferences, Miscellaneous, Abort jobs that take more than...)

Version 1.8.0 - 12 May 2017

Allow conversion of fixed layout comics and manga using Kindle Previewer version 3.10.1 or higher using the command line interface. See "Converting Comics and Manga" in the first post of this thread for more information.

Allow conversion of KPF files produced by the Amazon Kindle Create software using the command line interface.

Allow conversion of unzipped EPUBs in the command line interface by using an OPF as the input file.

Allow conversion of page numbers contained in an EPUB-3 NAV page-list within the source EPUB.

Include Previewer conversion logs in the calibre conversion job log even when conversion is successful.

Attempt to correct failures for some users when running 64-bit calibre under Windows Vista.

Internal changes to better match the Amazon Ion specifications. (KFX is based on Ion.)

Version 1.7.1 - 26 Mar 2017

Fix bug when running under MacOS introduced in version 1.7.0. (Fixes "TypeError: encode() argument 1 must be string, not None")

Version 1.7.0 - 22 Mar 2017

Fix incompatibility with Kindle Previewer 3.9 beta and improve handling of conversion error logs. (Fixes "KFX creation error: Unexpected conversion log: log_processEpub.txt")

Improve handling of non-ASCII system environments. (Untested under Mac OS.)

Remove support for Previewer versions older than 3.7 beta.

Minor changes and bug fixes.

Version 1.6.0 - 23 Dec 2016

Add support for Kindle Previewer 3.7 beta. (Previewer version 3.7 is recommended for use with this version of the plugin. It converts some books with unusual formatting that previous versions could not.)

Fix bug that caused some problems with the NCX TOC to not be corrected before conversion.

Version 1.5.3 - 12 Dec 2016

Fix conversion when using Kindle Previewer 3.6 beta under Mac OS.

Version 1.5.0 - 27 Nov 2016

Add support for Kindle Previewer 3.6 beta. (That is now the recommended version of the Previewer for use with this version of the plugin. It converts some books containing tables that previous versions could not.)

Capture log files during the first conversion attempt. This avoids the need to perform a second conversion to capture logs if the first one fails.

Automatically retry after conversion errors that occur inconsistently.

Version 1.4.0 - 24 Oct 2016

Allow a "mobi-asin" identifier to be used as the source of the book's ASIN.

The plugin tweak "kfx_output_force_cde_type_ebok = True" will cause converted books to no longer be marked as personal documents.

Version 1.3.0 - 20 Sep 2016

An invisible character will be added to empty table cells to work around a Previewer bug. (A visible character was used previously.)

If no ASIN is specified the converted book will be marked as a "personal document" and a unique ASIN will be generated. (An ASIN is required for the support of cover thumbnails on e-ink Kindles.)

Add support for Kindle Previewer 3.5 beta. (KFX generation from Previewer version 3.5 is unchanged from version 3.4.)

Version 1.2.0 - 15 Aug 2016

Add support for Kindle Previewer 3.4 beta. (That is now the recommended version of the Previewer for use with this version of the plugin.)

Allow conversion of page numbers contained in an NCX pageList or page-map.xml within the source EPUB. (Page numbers must be present in the EPUB. "Fake" page numbers will not be produced. EPUB 3 page-list and Amazon APNX are not supported.)

Correct some issues in the source EPUB that could prevent conversion by Previewer: character encoding, obfuscated fonts, background RECT in SVG, language "UND", missing/duplicated title, table cell with no visible text, and a few others.

Include the book title in pop-up conversion failure dialogs.

Save the Kindle Previewer version used within created KFX files to aid in future debugging.

Generate a unique content_id for books that do not have an ASIN.

Version 1.1.2 - 08 Apr 2016

Fix inability to highlight text in converted books on Kindle devices.

Assure author names are in the correct format for sorting.

Allow conversion using the plugin within calibre under Mac OS.

Version 1.1.1 - 30 Mar 2016

Fix error from calibre when the plugin is updated from an older version.

Version 1.1.0 - 30 Mar 2016

Add command line interface for advanced users. This provides a means for Mac users to produce KFX files since conversion within calibre is not currently working under Mac OS.

Version 1.0.0 - 26 Mar 2016

Initial release.

Attached Files
File Type: zip KFX Output.zip (72.3 KB, 1218 views)

Last edited by jhowell; 11-22-2017 at 03:51 PM. Reason: Version 1.13.0
jhowell is offline   Reply With Quote
Advert
Old 03-27-2016, 10:49 PM   #2
jhowell
Wizard
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: 1,784
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Open KFX with Kindle Previewer 3

KFX files produced by the KFX Conversion Output 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:
  • Kindle Previewer 3 must already be installed for the current user.
  • Download the .zip file attached to this post.
  • Extract the enclosed "Open KFX with Kindle Previewer 3.bat" file.
  • Place this .bat file in a permanent location of your choice on the PC.
  • Right-click the .bat file and select "Run as administrator". The script will report success or failure. Press enter to close it. (This will associate the script with .kfx files. Repeating this step will remove the association.)

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:


Version 1.0.0 - 24 Oct 2016

Initial release.

Attached Files
File Type: zip Open KFX with Kindle Previewer 3.zip (1,004 Bytes, 726 views)

Last edited by jhowell; 10-24-2016 at 09:35 AM.
jhowell is offline   Reply With Quote
Old 03-28-2016, 04:28 AM   #3
cerem0ny
Addict
cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.
 
Posts: 321
Karma: 2840782
Join Date: Jul 2014
Location: Australia
Device: ONE, H2O, Oasis, 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.
cerem0ny is offline   Reply With Quote
Old 03-28-2016, 09:16 AM   #4
jhowell
Wizard
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: 1,784
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Quote:
Originally Posted by cerem0ny View Post
but what IS funny is that the okugin seems to have more success converting .kfx than the previewer itself! Go figure. Why is that?!?
The first step in the conversion process is to convert the source format to EPUB, even if the book is already in EPUB format. This process can fix some things that would otherwise cause the Previewer to fail.

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.
jhowell is offline   Reply With Quote
Old 03-28-2016, 12:12 PM   #5
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 11,885
Karma: 15625327
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Here's the log from my failed attempt:
Attached Files
File Type: txt kfx log.txt (23.8 KB, 417 views)
Nate the great is offline   Reply With Quote
Advert
Old 03-28-2016, 02:10 PM   #6
jhowell
Wizard
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: 1,784
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Quote:
Originally Posted by Nate the great View Post
Here's the log from my failed attempt: ...
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:
  • Were there any other error messages displayed on your system when the conversion failed? If so, what?
  • Have you used the Kindle Previewer to verify that it functions properly on your system? You could try opening this book and verifying that it displays with Enhanced Typesetting (hyphenation) in the Previewer. Press Ctrl-I after opening the book in the Previewer and make sure that the information dialog shows "Enhanced Typesetting: Supported".
  • If you are running an anti-virus program could you try disabling it before launching a conversion to see if that helps?
jhowell is offline   Reply With Quote
Old 03-28-2016, 04:10 PM   #7
amordechai
Junior Member
amordechai began at the beginning.
 
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.
amordechai is offline   Reply With Quote
Old 03-28-2016, 06:27 PM   #8
jhowell
Wizard
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: 1,784
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Quote:
Originally Posted by amordechai View Post
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.
I was not able to test the plugin under Mac OS so it is not surprising that it failed to work.

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.
jhowell is offline   Reply With Quote
Old 03-28-2016, 07:37 PM   #9
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 11,885
Karma: 15625327
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by jhowell View Post
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:
  • Were there any other error messages displayed on your system when the conversion failed? If so, what?
  • Have you used the Kindle Previewer to verify that it functions properly on your system? You could try opening this book and verifying that it displays with Enhanced Typesetting (hyphenation) in the Previewer. Press Ctrl-I after opening the book in the Previewer and make sure that the information dialog shows "Enhanced Typesetting: Supported".
  • If you are running an anti-virus program could you try disabling it before launching a conversion to see if that helps?
The converter works, yes, and it did make a couple ebooks with the enhancements. I saw the hyphenation.

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.
Nate the great is offline   Reply With Quote
Old 03-29-2016, 12:12 AM   #10
Alice Green
Junior Member
Alice Green began at the beginning.
 
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.
Alice Green is offline   Reply With Quote
Old 03-29-2016, 12:31 AM   #11
Nate the great
Sir Penguin of Edinburgh
Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.Nate the great ought to be getting tired of karma fortunes by now.
 
Nate the great's Avatar
 
Posts: 11,885
Karma: 15625327
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
Quote:
Originally Posted by Alice Green View Post
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.
The easiest way is to do it via calibre.

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.
Nate the great is offline   Reply With Quote
Old 03-29-2016, 04:27 AM   #12
amordechai
Junior Member
amordechai began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2016
Device: Kindle PW
Quote:
Originally Posted by jhowell View Post
I was not able to test the plugin under Mac OS so it is not surprising that it failed to work.

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.
I wil definitely try the new version of the plugin and report back.

Thanks for your work!
amordechai is offline   Reply With Quote
Old 03-29-2016, 05:59 AM   #13
cerem0ny
Addict
cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.cerem0ny ought to be getting tired of karma fortunes by now.
 
Posts: 321
Karma: 2840782
Join Date: Jul 2014
Location: Australia
Device: ONE, H2O, Oasis, 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
cerem0ny is offline   Reply With Quote
Old 03-29-2016, 09:41 AM   #14
enjambement
Junior Member
enjambement began at the beginning.
 
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.
enjambement is offline   Reply With Quote
Old 03-29-2016, 11:48 AM   #15
jhowell
Wizard
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: 1,784
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Quote:
Originally Posted by Nate the great View Post
And then, on the next try, it converted the ebook which had failed 4 times already.
So now it is working - sorta.
Conversion by the plugin is dependent on Amazon's Kindle Previewer working properly and Amazon didn't do a very good job of with that software. For me it fails on more books than it works, but it does work or fail consistently on any particular book.

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:
Originally Posted by Alice Green View Post
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.
You do not need to locate the KDF files created by the Kindle Previewer to make use of the KFX Output plugin. It invokes the conversion function of the Previewer and uses the resulting KDF file automatically. But for those interested, I will describe more of how it works.

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".
jhowell is offline   Reply With Quote
Reply

Tags
kfx, linux, wine

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Conversion Output] KePub Output Plugin jgoguen Plugins 286 11-19-2017 08:58 PM
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


All times are GMT -4. The time now is 12:28 AM.


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