Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-15-2011, 10:13 PM   #1
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
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
AlexBell is offline   Reply With Quote
Old 06-16-2011, 01:56 AM   #2
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
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.
Manichean is offline   Reply With Quote
Advert
Old 06-16-2011, 02:40 AM   #3
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
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
AlexBell is offline   Reply With Quote
Old 06-16-2011, 04:01 AM   #4
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
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:
  • Don't use margins in the epub source (or use the ignore margins option during conversion), instead use blockquotes/nested blockquotes - each nested level gets ~1.5em left margin (depends on the kindle firmware)
  • Right margins are completely unsupported
  • Avoid any floating/wrap around styles, drop-caps, floating images, etc.
  • Table border styles aren't supported
  • Fine grained control of super/subscripts is unsupported

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 04:07 AM.
ldolse is offline   Reply With Quote
Old 06-16-2011, 07:46 AM   #5
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
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
AlexBell is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Gone! EPUB 2 MOBI conversion process MikeBailey1221 Conversion 3 05-27-2011 12:25 PM
NOW I understand 3dusty General Discussions 10 10-05-2010 04:34 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 12:35 PM.


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