Wednesday, September 4, 2013

Raspberry Pi Journal #19

E-Book with Calibre

Printing and making book is fun. But what is really interesting, is to have an e-book you can take with you wherever you go. With e-book, that means Kindle, Nook, or other dedicated e-book reader. Sure, you can bring along your laptop to view your PDF or PowerPoint files, but that's not fun. For true fun, we want dedicated e-book reader. That means EPUB file format for most. Kindle has its own format. MOBI for old Kindle, and EZ3W for the new Kindle Fire.

So, how can we convert our books into those format? Amazon has a converter service that converts Microsoft Word Document into its format. I will probably investigate that later. In the meantime, I'm using a program called Calibre.

This program is designed to function as all-in-one e-book solution. It shows. The download is quite sizable, and the program runs like a hog through mud. Just struggling to move. CPU at 100% at all times.

The important thing is that it works!

The first thing you want is a proper format for the book. This means that you should put proper formatting in place. Let's use Abiword for example. The formatting is usually set on "Normal". For different parts, we need to specifically specify each type. It's not enough that it looks right. It has to be the right type.

For Chapter Heading, use the Chapter Heading format. Bullet list? Use Bullet List format, and so on. This is very important. The reason for this is so that the automatic Table of Content generator can pick this up. It just makes things more convenient if you do.

Here is my novel. Well, short story. I did this during Nanowrimo event last year. Notice that everything is formatted properly. Abiword can save epub file format, and that's what I'm using.

Open the Calibre program. Add book into it. If you're using Raspberry Pi, you'll probably notice the extremely long load times. Most of the functions is provided by Python, I believe. So, not only it is running its own program, but also Python interpreter. And well, heavy slog.

Edit your Metadata here. That means Title, Author, and Cover. There are other info as well, such as Publisher. If you're feeling lazy, there's a button called "Generate Cover" that will automatically generate the book cover for you.

It's time to convert the book! In this case, I'm converting it to MOBI format for Kindle reader.

I'm leaving everything as default. I do make sure that the program automatically generate the Table of Contents. Notice that even though the size of the document is small, it takes a long time to format the piece. About 2 minutes to format 20 kb file? That's unbelieably long time!

If all goes well, you'll have an e-book! Normally, you can upload the document directly via USB connection. For some reason, I keep getting "Low Voltage" error, and the book refused to upload. How can I transfer the book to Kindle? There's always the PC method, but I'm going to see if I can skip PC altogether.

Sure enough, there is! Calibre comes with its own Content Server. What that means is, you start some kind of document provider over the net. Since I'm doing local, it's just a local connection.

I set the Server Port to 8088. Then it's time to fire up my Kindle! What I need to do is to connect to server on my Raspberry Pi at port 8080. Like this:


On my Kindle Keyboard, it falls under Experimental feature. Launch the internal web browser, and type in the URL into the address bar. Just remember to use your Raspberry Pi Hostname.

There it is! Both epub and mobi format are downloadable. We want the mobi format. All you have to do is click on it. If you have specified the cover in the metadata, then it will show up here. Otherwise, the default cover is the first picture on the book.

Oh, look! My very own e-book! Isn't that nice!

Well, enough time for gawking. Now, let's see. Next on my To-Do list is to write The Great American Novel. Yup. That's the ticket. See you later.

Oh, one more thing. You can have images in your e-book. But remember, e-book format does not have pages, so there's no point of you aligning the pictures so it looks nice on your word processor. It all depends on the set up on your e-book reader.

Have fun making your own e-book format!

No comments:

Post a Comment