06-15-2011, 11:13 PM | #1 |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Trying to understand conversion process
The background to this question is that I'm converting some print books by hand, from Word to XHTML, from XHTML to ePub, and from ePub to mobi with calibre. During the process I make sure that the XHTML and the ePub are valid.
I'm having some problems in the ePub to mobi conversion in that the layout (margins and headings and so on) is not always the same, and I don't know whether this is because of the limitations of mobi or because I've set up the conversion process incorrectly. In fact I'm not even sure what the limitations of mobi are in any detail - I know it can't flow text around images or do quotes indented on both sides, and I so far as I know it can't use external style sheets, but I'm hazy about the rest. So far as I understand the process calibre uses is something along the lines of - determine what input and output formats have been specified by the user - for ePub ebooks go through the stylesheet and XHTML files and put in local styling to achieve the effects the user has tried to specify in the external stylesheet. - write the resultant file into mobi format. Is this what calibre does? If not, could someone explain or point me to a reference please? There are obviously some things that even calibre can't get mobi to do - like flow text around images for example. Is there a listing anywhere which could tell me what these limitations are - that is, what not to ask calibre to do when converting an ebook to mobi? There is a listing of course on the Mobipocket site of what mobi can and can't do, but that's several years old, and in any event what I want to know is what calibre can and can't do when converting files into mobi format. Or to put it another way, what styling should I avoid so as to give calibre the best chance of producing a mobi version which looks reasonably close to the original ePub version? Regards, Alex |
06-16-2011, 02:56 AM | #2 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
There's a short introduction to the conversion pipeline in the user manual. As for MOBI limitations, the list you've found on the Mobipocket site is probably accurate, but if you don't like to use the official documentation, there's a section in the relevant wiki article.
|
Advert | |
|
06-16-2011, 03:40 AM | #3 |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Thanks, Manichean.
I guess I didn't explain myself clearly. I was hoping for something which is more detailed and calibre centred than the wiki article, and more up to date and calibre centred than the Mobipocket page. For example: Does calibre accept body { margin: 0; padding: 0; border-width: 0; font-size: 95%; text-align: justify; line-height: 120%; font-family: sans-serif; } ? Or does it require margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-width: 0; font-size: 95%; text-align: justify; line-height: 120%; font-family: sans-serif; } ? Regards, Alex |
06-16-2011, 05:01 AM | #4 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Calibre should take either of those examples without a problem.
Calibre's process isn't quite like your initial description. Input and output have no relation to one another. Calibre takes the input and converts it to OEB. If you want to see exactly how the conversion to OEB works, step by step, then enable debugging, and look at each stage of conversion in the debug output. The css flattening (what you describe as local styling), happens during part of this stage) Calibre then takes OEB and converts it to the output format.OEB is basically unzipped epub, and there are lots of things that epub supports that Mobi doesn't. If you have these sorts of things defined Calibre needs to make best effort decisions on converting such things to mobiml, and those decisions may not always be exactly what you like. If you start with epub then minimal changes will be made during conversion to OEB (Primarily css flattening). To get the closest mobi rendering to the original avoid epub features which are unsupported in mobi. The mobipocket docs covers these types of things - mobi hasn't been updated over the years, so any of the old info is still valid. Some of the Kindle's interpretations of MobiML have changed, but that's about it. A couple items which come up frequently/recently:
If you have specific suggestions on how a specific type of markup should be converted to MobiML for more accurate conversions then these often get implemented, but no-one is actively trying to improve upon the current level of MobiML output, as the reverse engineering effort is no fun. If you want to see the MobiML that Calibre is producing during conversion, then convert the mobi file back to epub with debugging enabled - the raw mobiml file will be in the debug directory. Last edited by ldolse; 06-16-2011 at 05:07 AM. |
06-16-2011, 08:46 AM | #5 |
Wizard
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
|
Thanks to you both. I'll look at the mobipocket information again.
Regards, Alex |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Image Gone! EPUB 2 MOBI conversion process | MikeBailey1221 | Conversion | 3 | 05-27-2011 01:25 PM |
NOW I understand | 3dusty | General Discussions | 10 | 10-05-2010 05:34 AM |
Help w/ Conversion Process | dftr | Workshop | 2 | 06-20-2009 09:33 PM |
New Conversion Process | Gideon | Kindle Formats | 2 | 02-20-2009 12:04 AM |