Elaine Smith Writes

Anything She Wants

DIY publishing

Step Two

Yesterday, I was talking about using Calibre to convert documents into the appropriate formats (ePub, Mobi, etc.) for eReaders.  The conversion process was easy to figure out and is astonishingly simple.  The only drawback is that there are some formatting glitches that occur.

Occasionally, you lose your paragraphs.  They get merged together or broken into two ‘graphs at odd places.  All those nifty Microsoft Word features like “smart quotes” and em dashes don’t translate well.  (You can turn that stuff off in Word, but if you forgot to do it before you converted in Calibre, you’ll have a mess.)  In addition, images don’t always end up where you intended.

There is, almost certainly, software you can buy that will allow you to edit an ePub or a Mobi file.  There may even be some freeware that will let you do it.  Tuesday’s Tip, however, is my discovery over the weekend that an ePub file is really just a bunch of HTML files and associated style sheets and image files all zipped up together into one file with the ePub extension.

If you have any kind of zip software and some knowledge of HTML, you can easily fix any problems with your ePub file.  (Note:  I said “easily,” not “quickly.”  It can take some time.)

The first thing to do is convert the document using Calibre.  Then, locate the resulting ePub file on your hard drive.  At this point, I recommend storing a copy of that file in some other location until you’ve finished tinkering.  It’s always good to be able to go back to where you started if/when you get hopelessly stuck.

Once you’ve made the backup copy–(Seriously.  I mean it.  You can never have too many backups.)–right-click on it and open it with your zip software (WinZip, 7Zip, jZip, IZArc–whatever your chosen utility is).

You should see a list of files–several of which have the extension .html.  These are now editable in any text editor.  (I think I mentioned, previously, that I like Notepad++.)

Make your changes (this is where you need that working knowledge of HTML) and check them by viewing each file in your browser.

When you are finished tinkering, select all the files (make sure you get all of them — the html files, the image files, the css files, the opf files and anything else that you unzipped from the ePub file) and use your zip software to re-create the archive.

Rename the new archive to the original name including the ePub extension.

You should now be able to view it on Calibre’s eBook viewer or on your ePub-compatible eReader.

If you’re trying to edit a MOBI file, it seems the simplest thing to do is convert it to ePub, edit, and then convert it back.

Now, one caveat to all of this is I haven’t yet figured out how DRM (Digital Rights Management) protected files work.  I’m talking here about unprotected files.  If you’re looking for info on DRM, you’ll either have to Google for yourself or wait until I’ve climbed that bit of the learning curve.