Guidelines for authors for creating content that will work well with the EPUB format.
EPUB files are used to display a book in an ebook reader. It is a standard format that is supported by many readers. Since the size of the reader can vary from a mobile device to a 9 inch screen to a laptop or monitor, it is difficult to create content that will look correct and be displayable on all devices. EPUB files should be considered a secondary source of information with the web, print or PDF version of the content being the primary version. Below are some general guidelines that will improve the display of your content in an ebook reader.
Because of the limitations of the EPUB spec and the devices that display EPUB files, some complex content may not display as well as it does on the web. Listed below are some of the limitations we have noticed from our testing. The list is in no way exhaustive, but can give a general view of some of the problems we have noticed.
1. Large tables do not display well on small devices. To make the table's contents fit on the screen, text may break and wrap so excessively as to impede readability. If the table is too wide, its contents will run off the edge of the screen with no side scrolling to access the off-screen part of the table.
2. Images will be broken into multiple screens when viewed in landscape on small devices. Most EPUB readers do not allow the author to control the size images when they are displayed. This is both good and bad. It is good because the reader can best calculate how to display an image for a given device. It is bad in that most readers will spread an image to fit the width of a device's display and adjust the image height to match proportionally. This will cause the image to be too tall to be displayed on a single screen when in landscape mode on a small device. Most readers will break the image into pieces across pages when the height is too great for a single page.
3. Links do not work on small devices. Ebook readers on smartphones and other small devices often do not support linking. This is true for links to other content inside the same EPUB file or to content outside the EPUB such as to a web site. Because the use of links is part of the EPUB file specification, we are adding the correct HTML so that the links can work at whatever point the readers decide to support it. Here are the rules followed for determining how a link is formatted.
- Links pointing to content inside the EPUB file are localized to link within the EPUB file
- Links to video files, audio files, source code, applets, PDFs, or any other document point back to the repository where the EPUB file was downloaded.
- Links to content outside the EPUB (whether in the same repository or to an outside site) are left as is. In devices where linking works and where a Web browser is installed, these links should open in the Web browser.
4. Multimedia files do not work in most ebook readers. Audio, video, Flash, and Java applet playback is not supported on most devices.
5. Formatting of display is limited. While we are trying to match the display of the EPUBs with the display of the web, some things will be different in the EPUB.
- Indentation is mostly removed so we can make the most use of the display area of small devices.
- Boxes around Note, Examples, etc. are different so we can again make the most use of the display area of small devices.
- Fonts may be different. Some readers allow the user to specify a font. All of them seem to have a different default font.
6. Preformatted text does not wrap. This causes the text to go off the screen and not be available to users. Source code used in a programming module is an example of preformatted text.
Guidelines for Authors
1. Limit the use of large tables. Large tables frequently do not fully display on small devices such as smartphones. They simply go off the screen and there is no side scrolling to view the part of the table that is not displayed. Use tables with only 3 or 4 columns with limited text.
2. Limit the file size of images. Since EPUB files are frequently downloaded to mobile devices, the size of the EPUB is important. Large image files (1 MB+) will display correctly on most devices, but they increase the download time required to access the EPUB. Some readers also have limitations on the size of an EPUB that it will open. EPUB files over 25 MB might not open on certain devices. To make sure your EPUB is accessible to the largest group of users, make sure image files are less than 1 MB in size. You can make an image file smaller by
- Lowering the resolution of the image. This will change the quality of the image, but it is a trade off with the image file size.
- Scale the image size to be smaller. Change the image to be no more than 600 pixels wide.
- Convert to image file formats with more compression. Using PNG or GIF file formats rather than jpeg can result in smaller files.
3. Images that have any unused or transparent areas should be PNG format with transparency. If your images are in a different file format, they will probably work, but PNG is the best format for EPUB files.
4. Avoid creating content that only links to a PowerPoint or PDF file. Since the display of PowerPoint and PDF is not supported on many small devices, an EPUB file that only contains such links would be largely useless to a reader. It is best to move the text from the PowerPoint or PDF to a module. This will allow users to access it using web, PDF, EPUB and print.
5. Use MathML for complex math only. As part of the EPUB generation, we convert simple math to text and complex math from MathML into images. If your math can be represented in text rather than MathML, please use text. Avoid using MathML to format text. Since we are converting MathML to images, the conversion of the text is not always reliable. If you can format the text outside of MathML, it is recommended that you do.
6. Java applets, video files, Flash files, and audio files are not included in EPUB files, but are linked back to the file's location online. Most devices will not support these kind of multimedia files. We encourage the use of multimedia in our content, but be aware that it might not be available in the EPUB file.