![]() |
#331 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 405
Karma: 2330752
Join Date: May 2012
Device: kt
|
Quote:
Mobi file doesn't have any enhancements. The file I posted is deleted during conversion process, so you must be quick to capture it ![]() I will have a look at env vars later. |
|
![]() |
![]() |
![]() |
#332 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,732
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
The .kdf file is generated by the Windows version of Kindle Previewer in the user's TEMP folder. If you enter %temp% in the Run dialog box, you'll find it in a book subfolder of a random UUID folder.
|
![]() |
![]() |
![]() |
#333 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,087
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Here is an overview of what I have been able to discover so far from examining kdf files:
Html and css files are replaced by text with associated formatting instructions in binary data structures. Semantic tags, such as em and strong, produce no difference in the result other than the formatting they represent. The possible formatting instructions are based loosely on css properties, but changed and somewhat simplified. The end result is much more like a reflowable pdf than an html document. Also, there are no soft hyphens or other hyphenation indicators added to the text. Last edited by jhowell; 02-16-2016 at 11:11 AM. |
![]() |
![]() |
![]() |
#334 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,087
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
One thing I have noticed is that the 'attachables' files, containing book images, are limited to about 3MB each. Books with lots of images will have several of these files. When downloading one of these books with the newer kindle apps, the download progress bar will quickly turn green. At that point the app will allow the book to be opened, even though image files are still being downloaded. This seems like a useful feature for those with slow internet connections. |
|
![]() |
![]() |
![]() |
#335 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#336 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 405
Karma: 2330752
Join Date: May 2012
Device: kt
|
|
![]() |
![]() |
![]() |
#337 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,108
Karma: 60231510
Join Date: Nov 2011
Location: Australia
Device: Kobo Aura H2O, Kindle Oasis, Huwei Ascend Mate 7
|
Quote:
|
|
![]() |
![]() |
![]() |
#338 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 405
Karma: 2330752
Join Date: May 2012
Device: kt
|
Quote:
Previewer runs following command to convert epub to kdf. Run it from lib/fc directory. Then watch /tmp directory for resulting files. Also notice the files that are created and then deleted. This applies to OS X, should be similar for windows. Code:
jre/bin/java -cp lib/EpubToKFXConverter-1.0.jar:lib/* com.amazon.kfxconverter.app.KFXGenApp -libDir . -tmpDir /tmp -outDir /tmp -inputFile sample.epub -locale en -amzncreator "Kindle Previewer 3.0.0" Code:
Usage: <main class> [options] Options: -amzncreator tool version (optional) -compressionType Compression type * -inputFile Input file * -libDir Base directory where all the required libraries are present * -locale The language for Kindlegen logs * -outDir Output directory where mastermobi is stored -outFileName Output file name for .mobi, if not given the input filename is taken * -tmpDir Temp directory where kdf is stored |
|
![]() |
![]() |
![]() |
#339 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
![]() |
![]() |
![]() |
#340 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,807
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi jhowel,
Quote:
KevinH |
|
![]() |
![]() |
![]() |
#341 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,807
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi jhowell,
Does the generated have any drmion atached to it or is it DRM free? If DRM free, what chances do you think someone might have to convert this reflowable pdf-like beast back to pure html and css? Thanks, KevinH |
![]() |
![]() |
![]() |
#342 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,087
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
A lot of what got added in that intermediate html file shown by baf doesn't appear in the kdf output. It looks to me that they are determining the final styling result of css for each html element and then translating that to their own simplified binary document model. I don't see any sign that they are pre-rendering to specific devices. That would be difficult given all of the possible font-face/size combinations and screen sizes for all iOS/Android devices. Also, I have been able to move non-device locked kfx files between devices of different resolutions and they rendered just fine. Drop caps appear to be handled by using their own non-standard style properties created just for that purpose. The document text doesn't appear to be altered at all. I think that kfx hyphenation is handled by the renderer on the user's device using a dictionary. |
|
![]() |
![]() |
![]() |
#343 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,087
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
In kfx format some information, such as metadata, is in an unencrypted container and the format of that data matches the format of the metadata found in a kdf file. In kfx all of the actual text and document layout is in an encrypted container. In kdf that data is all in the clear and is encoded in the same binary format as the metadata. (The encrypted kfx container almost certainly holds the same data format, once decrypted.) The data format is a representation of a nested data structure, sort of a binary version of json. I previously worked out some of the details and it is discussed earlier in this thread and there is even some code that partially handles it already in calibre. (See the PackedIon class.) I think it is quite doable to turn kfx/kdf back into html, but it would take some work to figure out how their document model maps back to standard html. It should be possible to do this preserving visible content and formatting, but some details, such as the exact css classes used in the original document will be lost. Of course the drm used for kfx books would still be an issue. Last edited by jhowell; 02-16-2016 at 09:15 PM. |
|
![]() |
![]() |
![]() |
#344 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
>I think that kfx hyphenation is handled by the renderer on the user's device using a dictionary.
I have a new Paperwhite and a new Fire; the latter shows auto hyphenation but the former doesn't. Also I don't understand how there could be a fixed page width in a reflowable book when the user has the ability to change the font size. I'm glad to see this discussion continued! |
![]() |
![]() |
![]() |
#345 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,087
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
If the book is in fact downloaded in KFX format on both devices and it renders differently I would like to know more about that. That was speculation by KevinH based on the contents of the intermediate file format posted by baf. I agree with you that the contents are reflowable, not fixed. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Kindle format vs ePub format is like using a compiler vs winzip? | Julius Caesar | Workshop | 1 | 09-01-2013 07:34 PM |
iPhone Convert epub format to kindle for iPhone format. Is it possible? | thecyberphotog | Apple Devices | 16 | 03-14-2013 01:04 AM |
No 'epub' format shown in Plugboards Format dropdown list | kakkalla | Library Management | 3 | 06-16-2012 04:23 AM |
Ebook in PRC format will not convert to any other format | Katelyn | Calibre | 0 | 10-01-2010 07:02 PM |
Master Format for multi-format eBook Generation? | cerement | Workshop | 43 | 04-01-2009 12:00 PM |