My main point in posting today is to correct an inaccurate statement I had made several months ago concerning how one would compress an EPUB using Windows. Since I work primarily on a Mac, I had made the statement based on what I had read on other sites, but recent testing has proved those sites to be incorrect.
Why Unzip an EPUB In the First Place
Once I’ve exported my EPUB using my recommended settings, I always extract the contents so that I can edit them. EPUBS are nothing more than ZIP files with their extensions changed to EPUB. On my Mac, I don’t even have to change the extension; I just drop the EPUB on Stuffit Expander. In Windows, change the extension to .zip and extract.
Once I extract the contents I begin editing them. I always replace InDesign’s exported style.css file with my own handwritten file. In addition, I often need to make manual edits to the toc.ncx file, especially if my chapter numbers are in separate paragraphs from my chapter headings (as in most of my book projects); 0nly the chapter names appear in the exported toc.ncx, so manually type in the chapter numbers. Sometimes I might need to make changes to the HTML files as well. I’ll often spend an hour or two in Dreamweaver editing my HTML and CSS to get it just right. Then I’m ready to pack up the finished EPUB!
Why Simply Re-Zipping Using Standard Tools Doesn’t Work
An EPUB is actually a slightly special type of ZIP file. Specifications stated that it is acceptable to compress all contents EXCEPT for the “mimetype” file. If you use a regular file compression utility, it will incorrectly compress ALL files, thus creating an invalid EPUB. Thus you need a special file compression utility to zip up your contents.
Previously I had reported, based on what I had read, that Windows machines could simply re-compress the EPUB contents using the built-in Windows compression utility, but when I tested it recently I found that this information was actually incorrect.
Zipping EPUBs on Macs
I use a free utility called ePub Zip. I keep a shortcut for it in my dock while I’m working on EPUB projects. Any time I need to zip up my EPUB content folder, I just drag the folder to the ePubZip icon in my dock.
Zipping EPUBs on Windows
There is a free tool called ePubPack. It requires the (also free) Microsoft .Net Framework. I tested it on a Windows XP machine and was able to generate an EPUB that opened on various readers and passed validation tests. Simply launch the application, select the mimetype file inside the EPUB folder, and choose a name and location for the EPUB file you’re saving.
A Peek into the Future?
I foresee a day when I may stop unzipping my EPUBs. Some readers may be familiar with Sigil, a free EPUB editor. I’m quite impressed with it, to the extent that I’m considering using it in a test run in the near future for a book project. If I find that it saves time and effort over my current workflow, which relies on extracting the EPUB contents and editing in Dreamweaver then recompressing, then I will make the switch. Stay tuned . . .