epub Format Conversion: Step 2--Calibre and Styling

After reading idiotprogrammer's post, I went ahead and attempted to use calibre on an OpenOffice formatted document versus the same story in my .txt format. The OpenOffice conversion yielded inconsistent tab stops as well as some rather strange spacing in places. Needless to say, I was not impressed.

What it did do, however, was rasterize the quadrat font I use. That was rather helpful, all things considered. In handling the font problem for me, it keeps me from actually creating the title of the story into an image. In addition, it auto-filled quite a few of the metadata tags for the epub format.

Now, onto the text conversion. Calibre flawlessly converted the .txt version of the file, adding the correct tab stops. What it didn't do? Well, so much. The title of the story was not included in the document although it showed up in the metadata. This conversion was quite well done and would be sufficient except for the fact that I now have to manually edit the data to get the title into the document.

So what to do? Even if I were to use Calibre for the grunt work of converting the text into epub format, I'd still need a script to unzip the format, and insert the appropriate metadata. This seems like a huge waste of time. Instead, I still think it makes more sense to actually construct the document from the text. By writing my own converter, I can easily use a simple ruby class to hold the base meta-information that will be used across all my writing, and then insert arguments via the command line to properly fill out the rest of the meta-tags.

Styling of the document (inserting the Shadow Publications logo for instance and the rasterized Title of the story) can then also be generated. This is where things can get very complex. The problem with trying to create a single style for all my epub books is trying to think of all the possible ways I may want it to look. That can be a major problem.

So again, start simple. I'm going to try and finish the converter this week and at least get my original short fiction properly done. And then after that, I can worry about making it more complex and useful. Of course, until I add some kind of UI to help a normal user fill out the metadata, such a utility will only be useful to me.

C'est la vie.

Cheers.

Share

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Duplicate blog...

Heyyaa.... jus saw a very same blog somewhere else too !!! guess somebody's been copyin ur stuff...

which epub reader are you using?

I just downloaded Stanza and it seems ok - but wondered if there was a better one out there? Also does Acrobat support epub? -j

epub Readers

As far as I know, Acrobat doesn't support epub. I use calibre on linux and Stanza on the mac. But at this point, I do much more reading of epubs on my linux workstation than on my little powerbook.

Calibre seems to support more features than Stanza (the desktop application, not the iPhone app) and so it's a better solution for me. It also is less standards strict which is a big problem if you're trying to validate your epubs. :D

Any reader you choose is bound to have some quirks. Use what works and what you like.

Cheers.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.