Introduction
The market has seen an explosion of reading devices. The devices use two main file formats: EPUB or AZW (Kindle). Would you like to create and manipulate these files? If so, this book is for you.
This book takes you through the processes of creating and manipulating the EPUB files with embedded fonts, images, audio, and video. EPUB files can be used to create not only books, but magazines, pamphlets, brochures, and whatever else you may need to make. This book also covers the details of converting the EPUB to a Kindle format so you can cover all devices by creating only one e-book.
Why This Book?
I attempted to not only show the basics to someone who has no prior knowledge of HTML, CSS, etc., but to allow the book to be used as a reference for those who do know the subjects. I also wanted to give examples and allow a reader to create their own files without requiring expensive applications. I found all the free software listed here to accomplish everything covered in the book:
image    Sigil   One of the main applications used is Sigil. It can be found at http://code.google.com/p/sigil/ along with the source code. This program allows you to edit and create EPUB files. You can get a version for Windows, Linux, or Mac. It supports EPUB Standard 2 (covered in Chapter 1). This application is used extensively in this book, so please be sure to download and install Sigil.
image    Calibre   Calibre is another useful program, found at http://code.google.com/p/calibre-ebook/ as well as the source code. More information can be found at http://calibre-ebook.com/. This program is also available for use on Windows, Linux, or Mac. Calibre is not an EPUB editor, but it allows for the management of EPUB libraries. It also creates EPUB files by converting files from one format to EPUB (covered in Chapter 6). The conversion ability is what makes Calibre extremely useful.
image    Type light free   Type light free is a font program that can be downloaded from www.cr8software.net/typelight.html. It is useful for opening and viewing font files or even creating your own.
image    Libre Office   Libre Office is a productivity suite of tools similar to Microsoft Office (for this book, you only need the Writer tool). Libre Office is available for Windows, Mac, or Linux. It is a free, open-source application located at www.libreoffice.org/download/. An extension called Writer2EPUB.oxt or Writer2HTML.oxt can be used to convert your documents to EPUB.
image    Google Chrome and Readium   To emulate an EPUB 3 e-reader, you can use the International Digital Publishing Forum (IDPF) Readium extension on Google Chrome or Chromium. Chrome can be downloaded from www.google.com/chrome. Once Chrome is installed, go to www.readium.org. Select the Install From Chrome Web Store button. Even though the extension is for EPUB 3 files, you can use it for EPUB 2 files as well.
image    Audacity   and its libraries To create Synchronized Multimedia Integration Language (SMIL) files, which are narrated, you need Audacity. The Audacity files can be downloaded from http://audacity.sourceforge.net/download/. Once installed, you’ll need to add two libraries: the LAME MP3 encoding library and the FFmpeg import/export library found at http://audacity.sourceforge.net/download/plugins. You may also need a microphone, or you can use Balabolka to create the narration files.
image    Balabolka   Balabolka is a useful EPUB reader that can also use speech to read an EPUB book to you. Options are available to save the speech as an MP3 file or other audio format. It is available at www.cross-plus-a.com/balabolka.htm for Windows only.
image    Inkscape   An image program to create and modify SVG files that can be downloaded from www.inkscape.org.
image    PIXResizer   A utility to change image sizes and convert to various formats from http://bluefive.pair.com.
image    Nook e-reader emulator   To emulate an e-reader, you can use the Barnes & Noble Nook emulator. It can be used on a Windows, Mac, iPad, Android Tablet, iPhone, iPod touch, and a smartphone running Android. The main download page is located at www.barnesandnoble.com/u/free-nook-apps/379003593. From this page you select the device you want to install the emulator on and install it.
image    Kindle e-reader emulator   You can also use the Amazon Kindle emulator. It is available for smartphones such as the iPhone, Android, Windows Phone 7, and the Blackberry, as well as the iPod touch. It can be downloaded for a PC running Windows or a Mac. It can be installed on an iPad or an Android Tablet. These free apps can be downloaded at www.amazon.com/gp/feature.html/ref=sv_kstore_1?ie=UTF8&docId=1000493771. The Kindle Emulator will be used in Chapter 6 to view EPUB files in the Kindle AZW format.
image    7-Zip   EPUB files are packaged within a ZIP file and then renamed to EPUB. You will need a ZIP program to extract or compress the files when needed. 7-Zip is a free, open-source application found at http://7-zip.org/, with various Windows and processor versions available. For Linux and Mac, a version of 7-Zip called p7zip is also available on the download page.
image    SHA-1 Checksum Utility   Go to www.cnet.com and in the search box, type MD5 SHA-1 Utility. Download the MD5 & SHA Checksum Utility. The utility allows you to create SHA-1 hashes for files.
image    NotePad++   A file editor that has numerous uses. It can be found at www.notepad-plus-plus.org.
image    Clipyard   Flash creator for Windows found at www.goldshell.com/clipyard.
image    QFlash   Flash creator for Linux that can be downloaded from www.sourceforge.net/projects/qflash.
image    Websites   Two websites that will be necessary to obtain e-books to use for examples are http://manybooks.net/ and http://www.gutenberg.org/. Both of these sites have numerous free e-books in EPUB and other formats. Any example used in the book will give the web address and the book title.
image    www.ComicBookPlus.com   Has numerous public-domain comic books to download for free.
image    www.DaFont.com   A website to download free font files.
NOTE
image
I would ask anyone who finds these applications and websites useful to please make a donation for their improvements.
What to Do Next?
Some people may ask what can be done with the knowledge they learn from this book. One thing you can do is create EPUB books and sell them. Sites such as www.NookPress.com will sell your EPUB books for you. If you convert your EPUB books to Kindle format (covered in Chapter 6), the books can be sold at Amazon’s site: kdp.amazon.com. Many other websites can sell EPUB files, and this can be profitable for some people.
Who Should Read This Book
This book is for anyone who wants to be able to create or edit EPUB files. No prior knowledge of EPUB is necessary other than some ability to learn basic HTML, XHTML, XML, CSS, and JavaScript.
This book is for you if
image    You are a newcomer to EPUB. You must be able to download and install files from the Internet. These files include applications and free EPUB files to use as samples.
image    You have some knowledge of EPUB or even advanced experience. This book can extend your knowledge using more tools and techniques.
image    You have experience with HTML and wish to learn XML or CSS.
image    You wish to learn the basics of JavaScript to enhance EPUB functionality.
What This Book Covers
This book covers the following:
image    Chapter 1 introduces you to EPUB standards and the contents of the EPUB file, with some important background information. The chapter sets the groundwork for the remaining chapters.
image    Chapter 2 covers the basics of HTML and XHTML that are supported by EPUB standards. You will learn how to code the main book parts displayed on any device. The chapter gets you started on creating the body of your EPUB.
image    Chapter 3 shows how CSS is used to manipulate the style of the XHTML files and enhance the visual quality of the EPUB. It continues the work of Chapter 2 by showing you how to use CSS to enhance the format of your book body. This is more than bold, underline, italics and the like.
image    Chapter 4 goes into fonts, images, and colors. Learn how to further enhance an EPUB by changing fonts and colors, as well as adding images. Chapter 4 includes sample files that can be downloaded from McGraw-Hill (all remaining chapters contain samples).
NOTE
image
All sample files referred to in the book can be downloaded from www.mhprofessional.com/EPUB.
image    Chapter 5 details the structure and use of the Navigation Center eXtended (NCX) and Open Packaging Format (OPF) files. These are used to set up reading order and create the table of contents.
image    Chapter 6 explains how to convert many e-book and file formats to EPUB. It also shows how to take an EPUB file and convert it to other formats, including the Kindle format and others.
image    Chapter 7 has information about the use of digital rights management (DRM), signatures, and font obfuscation to protect an EPUB and prevent it from being shared freely.
image    Chapter 8 provides details about the enhancements of EPUB 3. It explains how to add audio and video files, how to use Mathematics Markup Language (MathML), how to set up the new navigational file, how to make fixed layouts, how to create SMIL, and how to add Flash files to your EPUB.
image    Chapter 9 details the use of JavaScript to enhance EPUB 3 files and create interactive e-books, which can provide added functionality.
You can read this book all the way through, or you can look over just the chapters that interest you. Examples in each chapter do not rely completely on material created in other chapters.
Chapters 4 through 9 include working examples to help you understand the concepts that are being covered in that chapter. Each chapter has a list of key points at the beginning to summarize these concepts.
Many chapters contain Notes, Tips, and Cautions. Keep these sections in mind as you read.