Tag Archive: calibre

To Digital in a Day: Act III

Sat 9:30 PM

This book needs a cover; that would have been a nice tutorial on Covers for All Book Formats More or Less, but that’s a blog post for another day.

Time for Mobipocket.

mobigen run on the Epub file finishes in a minute. File checks out.

Sat 9:32 PM

Wondering what format to do next.

Oh yes, PDF. Which means a detour via html2ps and then Ghostscript’s ps2pdf.

This is a little more complicated.

Especially since html2ps is segfaulting for some reason on my Mac.

Sat 10:02 PM

Removed incidental cause of the seg fault, will be fixing it for real tomorrow or sommat.

Or… not. html2ps doesn’t deal with raw utf8; it lives on ISO encoding. Like the rest of perl. No Ruby (defaults to utf8) equivalent around.

Sat 10:24 PM

The other option I know of, wkpdf, needs a consolidated HTML file.

So… let’s take the worked original file, and add anchors. MacVim again!

This time I’m running short perl filters against the text directly in the editor, then using grep to grab the anchors and more regular expression/replace to create the links.

Incidentally, this also gives us the one-file HTML version with a table of contents.

Sat 11:09 PM

Well, I ended up enabling the web server with PHP5, increasing memory limits and PCRE backlimit, to try to run html2pdf, the PHP version. But most of my problems stem from the document being too large.

At this point, I can already generate every other format. Except for PDF with hyperlinks (PDF without such links I can do). Which has always been a bit of an Achilles heel for me.

By the way, apparently the Mac these days comes with textutil, so I might have been able to save a bit of time earlier in Act I. Hey, it can convert to… Word document, Open Office Document Text, …. hang on….

Nah, doesn’t preserve inter-text hyperlinks.

Sat 11:20 PM

Let’s just get all the other mobile formats out of the way.

Using calibre’s any2lrf, we get a valid Sony Reader file in under two minutes.

Using calibre’s oeb2lit, we get a valid Microsoft Reader file in under two minutes.

It takes me longer to type all this down for you and to locate my bookmark to the calibre site, actually.

Sat 11:29 PM

The state of affairs:

  • Valid Epub.
  • Valid Mobipocket (MOBI).
  • (Really) Valid HTML with linkage.
  • Valid Sony Reader.
  • Valid Microsoft Reader.

All in one day. Actually, counting up the time, less than one day.

LRF to HTML: The Rough Guide

As of this writing, calibre, which can convert many things from one format to another featuring command-line tools, does not convert LRF to HTML, or indeed, to most anything else other than LRS, an XML format. Currently this is not a high-priority item to fix in calibre itself, because calibre is aimed at converting things to LRF. (The ePub conversion is still relatively new and shiny.)

ETA: Here’s the LRS specification.

So. Heck. Why not. I’m using Ruby, by the way, because Ruby has the kick-ass REXML library, which also forms the cornerstone for my ruby-epub stuff (still in the making).

Geekery after the cut.

Click here to read more »

Kindle Advent Calendar: Day 15 – Julian: A Christmas Story

Julian: A Christmas Story
by Robert Charles Wilson
PDF1Kindle/Mobipocket2ePub34Hardcover

The world of Julian Comstock: events of the 21st century have resulted in near-complete technological collapse, tossing the world into an age akin to the mid-19th century. In the United States, the President rules alongside a puritan theocracy, and the country is warring with Europe.

During these troubled times, the friendship between a rural low-born boy and the aristocratic nephew of the President carries them through a holiday of rediscovering the past; but not all is quiet in Williams Ford as the prospect of war shatters the idyllic rural town.

Plus it’s an election year.

A Christmas Story is a self-contained part of a forthcoming novel, Julian Comstock: A Story of 22nd-Century America.

S∂’s full 2008 Advent Calendar.

  1. From kith.org. []
  2. Robert Charles Wilson has been gracious enough to let me put up free versions of Julian: A Christmas Story as Mobipocket and ePub versions. Unlike other works I’ve turned into eBooks, this one is under copyright and without a Creative Commons license, which means that permission is required for distribution. []
  3. Yes, this is the first work for which I’ve created an ePub version. The Sony Reader, Adobe Digital Editions, and quite a bit of other software can digest ePub. Calibre helped quite a bit with creating a rough version from the PDF to work with. []
  4. By the way, Safari and possibly Internet Explorer sometimes want to unzip the ePub file. Use save-as instead. []

Part of a series