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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2012, 04:15 PM   #1
sarafnikit
Junior Member
sarafnikit began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
KindleGen Conversion Process Documentation

I am doing a project in my college about ebook format conversion. And i wanted to learn how does KindleGen actually work. I know KindleGen is a proprietary software and not open source, so its source code wont be available. But even if I can get the documentation of how the conversion process takes place in KindleGeb, it would be a great help to me. So, anyone helping me out, a Big Big Thank you for you.
Secondly, i wanted to know can the KindleGen serve multiple request at the same time ??
And Lastly, can the KindleGen be deployed on the a Linux Server, to be used by another software running on the same server ?
Thank you in advance.
sarafnikit is offline   Reply With Quote
Old 03-25-2012, 07:35 PM   #2
KevinH
Guru
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 842
Karma: 349410
Join Date: Nov 2009
Device: many
Hi,

Check out the calibre ebook conversion software to see how to covert to mobi from an oeb/epub. It is the closest thing to what kindlegen does. Similarly, I have some alpha/beta quality python code that will convert from an epub to Kindle KF8 standalone version (not the joint/dual version). This code is experimental but does work. It requires both the lxlm and html5lib python modules be installed. You can also look at the Mobi_Unpack code to see the how Mobis are constructed.

KevinH
KevinH is offline   Reply With Quote
 
Enthusiast
Old 03-25-2012, 08:08 PM   #3
sarafnikit
Junior Member
sarafnikit began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
Thank you so much KevinH for your reply.

Firstly, what is the difference between between the Kindle Format 8 Standalone version and the dual version ?
Secondly, is this KF8 format readable in the previous Kindle Devices ?
And Lastly does your code generate mobi file too?
If you are thinking to make your code open source and don't mind sharing it, then can you please provide me your code, so that i can have a look at.
sarafnikit is offline   Reply With Quote
Old 03-25-2012, 09:07 PM   #4
KevinH
Guru
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 842
Karma: 349410
Join Date: Nov 2009
Device: many
Hi,
Quote:
Originally Posted by sarafnikit View Post
Thank you so much KevinH for your reply.

Firstly, what is the difference between between the Kindle Format 8 Standalone version and the dual version ?

Secondly, is this KF8 format readable in the previous Kindle Devices ?
And Lastly does your code generate mobi file too?
If you are thinking to make your code open source and don't mind sharing it, then can you please provide me your code, so that i can have a look at.
Kindlegen generates dual KF8 mobi ebooks which are actually two ebook versions in one .mobi file. The first is an older version mobi and the second is a KF8 mobi.

No, the ebooks my code generates can not be read on older kindles only newer ones that support KF8.

I think you should start by reading and uderstanding the Wiki we have here at mobileread to understand the mobi format. Then look at Calibre sourcecode to see how to read and convert both older and newer mobi formats. Simply google calibre to download the source, it is GPL.
KevinH is offline   Reply With Quote
Old 03-26-2012, 08:52 AM   #5
sarafnikit
Junior Member
sarafnikit began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
Thank you so much for your reply!!

So, now finally i'll dive into the Calibre's Code.

Thank you!!
sarafnikit is offline   Reply With Quote
Old 03-29-2012, 09:11 AM   #6
sarafnikit
Junior Member
sarafnikit began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
Hey KevinH

Are you planning to make your code, for the conversion of epub to kf8 standalone format OPEN SOURCE?

Thanks
sarafnikit is offline   Reply With Quote
Old 03-29-2012, 11:30 AM   #7
KevinH
Guru
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 842
Karma: 349410
Join Date: Nov 2009
Device: many
It isn't available now. It will be once it has been incorporated into Calibre.

As I explained earlier, there is more than enough information in the Calibre source in calibre/src/calibre/ebooks/ module for any school project to describe how Kindlegen might work. Kindlegen would need to generally follow the same sequence of steps in its conversion process as calibre uses right now.

There is also our own Wiki here that does a great job explaining the format of the .mobi files, plus Mobi_Unpack plus DumpMobiHeader, plus Mobi2Mobi, MobiPerl, etc. Have you read and studied the Wiki?

Have you read and studied the Calibre source code (at least the ebook conversion parts)?

All these help to explain things that is more than sufficient for any school project. As you can see, converting to Mobi is not trivial and the mobi file format can be quite complex at points.

If all of that is not enough for a school project, what exactly are you looking for and more importantly why do you need it? No one here wants to do your school work for you and you will learn nothing by us doing it.

If this is not a school project and you are looking for working code for some other reason that you plan to incorporate into your own software, then you have gone about it completely in the wrong way.

Care to explain?
KevinH is offline   Reply With Quote
Old 03-29-2012, 03:42 PM   #8
sarafnikit
Junior Member
sarafnikit began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
My project was to get a documentation ready for the whole process involved during the conversion of a file form epub to mobi.
So, instead of going over the source code of Calibre, i was searching the web and asking people where can i get such a document(if it has been documented), thinking that it, both the formats are so well know, that it may be documented somewhere.

And at last, i realized that there cannot be an easy solution and stopped searching for it and looked at the source code of Calibre and Mobiperl. But found out that Calibre is much more complex(obviously as it is all in one converter and not just the converter for one file).It first converts the file into XHTML, then parses that XHTML applying many algorithms on it, then converting that XHTML to the required format.

But during the conversion of EPUB to MOBI the following are the largely major steps as i could understand by going through MobiPerl:-
1.Parsing the opf file to get the tree structure of the file.
2.Cleaning up the HTML files - Adding the tags which are needed by MOBI and removing the ones which are not supported by it.
3.Compiling the opf and HTML files, including all the necessary headers for the mobi in the process.
(Though many more things are involved like keeping a check on the metadata, table of contents, guide section etc.)

Am i correct??

Thank you so much, for giving your time.
sarafnikit is offline   Reply With Quote
Old 03-29-2012, 07:03 PM   #9
KevinH
Guru
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 842
Karma: 349410
Join Date: Nov 2009
Device: many
Hi,

Just to be very clear ... this project is a school assigment is that correct or not?

If so, it is hard to believe that the instructor did not know that the mobi file format has never been officially documented, nor has the conversion process. Seems more like a work assigment than a school assignment.

Quote:
Originally Posted by sarafnikit View Post
And at last, i realized that there cannot be an easy solution and stopped searching for it and looked at the source code of Calibre and Mobiperl. But found out that Calibre is much more complex(obviously as it is all in one converter and not just the converter for one file). It first converts the file into XHTML, then parses that XHTML applying many algorithms on it, then converting that XHTML to the required format.
Just what do you think an epub is? It is a set of xhtml files, css stylesheets, images, etc all linked by an opf file, ncx, etc. So the calibre code does exactly what it needs to covert from its internal oeb format (very similar to an epub) to mobi.

Quote:
But during the conversion of EPUB to MOBI the following are the largely major steps as i could understand by going through MobiPerl:-
1.Parsing the opf file to get the tree structure of the file.
2.Cleaning up the HTML files - Adding the tags which are needed by MOBI and removing the ones which are not supported by it.
3.Compiling the opf and HTML files, including all the necessary headers for the mobi in the process.
(Though many more things are involved like keeping a check on the metadata, table of contents, guide section etc.)

Am i correct??
Broadly, yes, there are lots of other steps you are missing such as converting the css to the strange html markup used by mobis, converting and scaling images, converting metadata, building the mobi header, building the palm db container file, processing the ncx, etc.

The devil is in the details so reading and understanding the calibre code is the right way to go if you truly want to understand the conversion process.
KevinH is offline   Reply With Quote
Old 03-29-2012, 07:09 PM   #10
sarafnikit
Junior Member
sarafnikit began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
Thank you so much for your help....

You don't realize how much you have helped me!!

Thanks once again....
sarafnikit is offline   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
KindleGen Documentation sarafnikit Amazon Kindle 1 03-25-2012 01:32 PM
KindleGen: Epub to Mobi conversion virtual_ink Kindle Formats 21 11-18-2011 08:00 AM
Trying to understand conversion process AlexBell Conversion 4 06-16-2011 07:46 AM
Help w/ Conversion Process dftr Workshop 2 06-20-2009 08:33 PM
New Conversion Process Gideon Kindle Formats 2 02-19-2009 11:04 PM


All times are GMT -4. The time now is 03:50 AM.


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