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 10-16-2017, 09:51 AM   #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,785
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
[Conversion Plugin] KFX Input

KFX Conversion Input Plugin

The KFX Input plugin allows books in KFX format to be converted to other e-book formats, such as EPUB, for archival and for reading on alternate devices. Amazon uses KFX format for the delivery of most e-books to customers. It supports advanced features, including Enhanced Typesetting and Page Flip, on Amazon apps and devices. A more in-depth discussion of the KFX format can be found in this thread.

Amazon's KF8 (azw3) format is superior to KFX as a source for conversion. This plugin has limited usefulness as long as KF8 is still easily obtainable.

As delivered by Amazon, books in KFX format are usually composed of multiple KFX container files. The entire set of KFX files that make up the book is required for successful conversion. Since calibre handles all e-book formats as a single file, this plugin accepts a ZIP archive with the extension ".kfx-zip" containing multiple KFX files. This will appear in calibre as KFX-ZIP format.

Alternatively, an entire book's content may be contained within a single monolithic KFX container file with a ".kfx" extension, as produced by the KFX Output plugin. The KFX Input plugin accepts this format (KFX) as an alternative to the multi-container format (KFX-ZIP).

Monolithic KFX is different from the files delivered by Amazon with a ".kfx" extension! Those contain only part of the book's content and cannot be converted individually.

Amazon's Kindle Textbook Creator and Kindle Create software export books in KPF (Kindle Package Format), which is proprietary to Amazon. This plugin will allow conversion of KPF, so that the author has greater control over the finished book.


Installation:

Install the plugin and restart calibre as described in the Introduction to plugins thread.


Usage:

A book must have either KFX, KFX-ZIP, or KPF format for conversion to be possible. The plugin is activated by selecting the proper input format when converting books in calibre.

A command line interface is also available. (See below.)


Producing KFX-ZIP archives for conversion:
Spoiler:

There is currently no software available to produce KFX-ZIP archive files. Each user of this plugin must produce their own for now. Because the procedure for doing this will vary based on the user's system, only general instructions are supplied here.
  • First, the KFX files that make up the book must be located. For Kindle for PC/Mac version 1.19 or greater the "My Kindle Content" folder will contain a sub-folder for each book, named with the ten character ASIN of the book followed by "_EBOK". The ASIN for each book is shown in the "Product details" of the book's Amazon web page.
  • Once the sub-folder of the book is located you can determine if that book is in KFX format by looking for a KFX DRM voucher file in it. A DRM voucher typically has a name containing the word "voucher" in it, such as: "amzn1.drm-voucher.v1.12d0d34e-b0de-11e7-abc4-cec278b6b50a.voucher". Another sign that a book is in KFX format is the presence of a file with the extension ".azw.md".
  • The main KFX file for the book, with an ".azw" extension, will have DRM encryption and must be replaced by an equivalent file that has had DRM removed. KFX is not yet supported by the most commonly used DRM removal tools, however a standalone program that can remove DRM from individual KFX files is available at Apprentice Harper's GitHub. Detailed instructions for DRM removal are not allowed on MobileRead so the process is not described here.
  • Once the book no longer contains DRM, create a ZIP archive of the book folder using a tool such as 7-Zip or WinZip. Extra files are ignored by the plugin so it is safe to include the entire book folder. Afterwards, manually change the file extension of the archive from ".zip" to ".kfx-zip".
  • The KFX-ZIP file can then be added to a calibre book entry using drag-and-drop or the "Add files to selected book records" (Shift-A) function. (If the "Add files" function is used the file type in the dialog must be changed from "Books" to "All files" in order to see KFX-ZIP files.)

A similar process is possible for KFX books from e-ink Kindle devices. In that case the KFX-ZIP archive needs to contain the ".kfx" file from the device's "documents" folder along with the contents of the ".sdr" folder associated with the book.

A software development strategy that could automate the above process is described in this thread. That work is outside of the scope of this plugin.



Command Line Interface:
Spoiler:

The KFX Input plugin command line interface bypasses the calibre conversion pipeline and can result in an EPUB that more closely matches the content and formatting of the original book. Conversion using this method is required for books with special formatting, such as fixed layout comics.

Code:
usage: calibre-debug -r "KFX Input" -- [-h] [-e EPUBVERSION] infile [outfile]

Convert e-book from KFX to EPUB.

positional arguments:
  infile                Pathname of the KFX, KFX-ZIP, or KPF file to be converted to EPUB.
  outfile               Optional pathname of the resulting EPUB file.

optional arguments:
  -h, --help            show this help message and exit
  -e EPUBVERSION, --epubversion EPUBVERSION
                        EPUB version to generate: 2.0, 3.0, 3.1



Limitations:
Spoiler:

The KFX format is undocumented and has changed over time. Some books may fail to convert or result in incorrect content or formatting. If the results of a conversion appear incorrect, it is recommended that the conversion job log be checked for errors and warnings. Please report problems in this MobileRead thread.

KFX is more highly processed than Amazon's KF8 (azw3) format, causing some details of the original e-book provided by the publisher to be lost during conversion, such as the exact HTML tags and styles used in the book. However, all of the text and most of the formatting should be preserved. Images may be reduced in resolution or converted to black and white to match the capabilities of the device on which they are viewed. These limitations make KFX less suitable for archival and conversion when compared with KF8.

All books currently supplied by Amazon in KFX format have DRM. This plugin only supports KFX files without DRM encryption. Removal of DRM must be accomplished by some means before this plugin can be used on Amazon-provided books.

This plugin does not contain a copy of the KFX symbol table. Some error messages may refer to KFX symbols in numeric form (such as $123). Interpreting these is not within the scope of this plugin.

This plugin requires calibre version 2.0 or later. Version 3.9 is later is required for conversion of books from e-ink Kindles containing JPEG-XR images.



Version History:
Spoiler:


Version 1.0.1 - 16 Oct 2017

Remove extraneous files that were inadvertently included in the initial release.

Version 1.0.0 - 16 Oct 2017

Initial release.

Attached Files
File Type: zip KFX Input.zip (80.3 KB, 4148 views)

Last edited by jhowell; 10-16-2017 at 05:22 PM. Reason: version 1.0.1
jhowell is offline   Reply With Quote
Advert
Old 10-16-2017, 09:52 AM   #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,785
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Reserved post
jhowell is offline   Reply With Quote
Old 10-16-2017, 02:51 PM   #3
odamizu
maniac
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 665
Karma: 1670000
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Awesome! Thank you, jhowell, for all your work unraveling KFX and making it more accessible to all!

Last edited by odamizu; 10-16-2017 at 02:53 PM.
odamizu is offline   Reply With Quote
Old 10-16-2017, 07:37 PM   #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,785
Karma: 17299998
Join Date: Nov 2011
Location: Florida
Device: iPad Air 2, Kindle PW2, Nexus 7
Quote:
Originally Posted by odamizu View Post
Awesome! Thank you, jhowell, for all your work unraveling KFX and making it more accessible to all!
You're welcome.

I know that this plugin isn't especially useful right now given the continued availability of KF8 and the lack of automatic DRM removal for KFX. But I thought it would be best to be prepared in case this capability is needed in the future.
jhowell is offline   Reply With Quote
Old 10-18-2017, 01:45 AM   #5
odamizu
maniac
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 665
Karma: 1670000
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Quote:
Originally Posted by jhowell View Post
... I thought it would be best to be prepared in case this capability is needed in the future.
Absolutely! Hopefully KF8 and EPUB will continue to be available and accessible for a long time to come, but it gives me great comfort knowing your plug-in (and the Pascal decrypter) exists, just in case. for all your time and effort.
odamizu is offline   Reply With Quote
Advert
Old 10-18-2017, 02:01 AM   #6
Terisa de morgan
Wizard
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 4,510
Karma: 4813526
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Aura, Kobo Aura One, XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you very much, perhaps some of the things which you say they limit its usefulness will disappear in a near future.
Terisa de morgan is offline   Reply With Quote
Old 10-18-2017, 05:25 AM   #7
mbovenka
Wizard
mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.mbovenka ought to be getting tired of karma fortunes by now.
 
Posts: 1,654
Karma: 6400817
Join Date: Oct 2007
Location: Almere, The Netherlands
Device: Kobo Aura ONE
Quote:
Originally Posted by odamizu View Post
Absolutely! Hopefully KF8 and EPUB will continue to be available and accessible for a long time to come, but it gives me great comfort knowing your plug-in (and the Pascal decrypter) exists, just in case. for all your time and effort.
+1. Not that I expect EPUB to go anywhere, as Amazon has no control over it, but KF8 might.
mbovenka is offline   Reply With Quote
Old 10-18-2017, 05:18 PM   #8
odamizu
maniac
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 665
Karma: 1670000
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Quote:
Originally Posted by mbovenka View Post
+1. Not that I expect EPUB to go anywhere, as Amazon has no control over it, but KF8 might.
Amazon isn't the only one we have to worry about. Adobe has their hardened DRM. So far ADE 2.0.1 still works for most Adobe epubs, but that could change.
odamizu is offline   Reply With Quote
Old 10-18-2017, 05:20 PM   #9
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 51,097
Karma: 182423895
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage, Yotaphone 2
Thank you for this most impressive bit of work.
pdurrant is offline   Reply With Quote
Old 10-18-2017, 11:45 PM   #10
Iris-maybe
Junior Member
Iris-maybe began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2017
Device: kindle paperwhite2
I do not think this is unuseful right now since Epubor has update this software to remove Kindle KFX DRM yesterday. Unfortunately, they can not convert KFX. This is really what I need. Thanks for your contribution.

Last edited by Iris-maybe; 10-19-2017 at 12:21 AM.
Iris-maybe is offline   Reply With Quote
Old 10-19-2017, 01:33 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 50,408
Karma: 43720217
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
epubor is a rip-off of Calibre (overall).
JSWolf is offline   Reply With Quote
Old 10-19-2017, 01:53 PM   #12
odamizu
maniac
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 665
Karma: 1670000
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Quote:
Originally Posted by JSWolf View Post
epubor is a rip-off of Calibre (overall).
And epubor will likely soon rip-off jhowell's awesome KFX conversion plug-in
odamizu is offline   Reply With Quote
Old 10-19-2017, 01:58 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 50,408
Karma: 43720217
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by odamizu View Post
And epubor will likely soon rip-off jhowell's awesome KFX conversion plug-in
I would not be surprised if they do.
JSWolf is offline   Reply With Quote
Old 12-11-2017, 12:46 PM   #14
issybird
o saeclum infacetum
issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.issybird ought to be getting tired of karma fortunes by now.
 
issybird's Avatar
 
Posts: 9,498
Karma: 100533919
Join Date: Oct 2010
Location: New England
Device: H2O, Glo HD, Aura One
The rest of this conversation has been moved to a new thread here, per request. Please continue the conversation along those lines there; this thread is for the support of the KFX Input plugin only.
issybird is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Conversion Input] Microsoft Doc Input Plugin igi Plugins 67 08-31-2017 02:54 PM
KFX conversion, transfer back to library issue. shoelesshunter Conversion 2 08-22-2017 07:40 PM
[Conversion Input] LaTeX Formulas Input Conversion Plugin sevyls Plugins 0 03-23-2015 06:52 AM
[Input Plugin] DOCX Input SauliusP. Plugins 42 06-05-2013 05:01 AM
Looking For MHT Input Conversion Plugin FlooseMan Dave Plugins 4 03-30-2010 06:52 PM


All times are GMT -4. The time now is 08:36 PM.


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