InDesign to ePUB Problems: Some symptoms and their remedies

Image for InDesign to ePUB Problems: Some symptoms and their remedies

Getting InDesign (CS5) to produce a decent ePUB format ebook is so problematic, that I sometimes wonder why we are bothering to use it at all! We could after all, use tools to build the components of the ePUB package by hand coding. Dreamweaver is a possibility and Sigil may also be a way to go.

However, one strategy may be to use InDesign as a starting point and then accept that we need to edit the resultant XHTML and CSS. This is the method that I am using, and I am promoting this method with my students.

After a few frustrating sessions recently, I thought I would note down a list of problems that can be solved. This may not be a comprehensive list...



Making the HYperlink Destination

InDesign has a reasonably understandable way of building hyperlinks.

  • First, you create the destination, by selecting the text on the page where you are hoping to take the user after they click the hyperlink.
  • Show the appropriate tools here: Window > Interactive > Hyperlinks.
  • Select a word and then create a new hyperlink destination. The name will be the selected word.
  • Once done, go to the page location in the InDesign document, where you want a hyperlink.
  • Select the word, and then 'Create New Hyperlink'.

This will result in an interactive hyperlink. But:

Adding the hyperlink

In the ePUB, you are very likely to have more than one XHTML file in the package. The hyperlink will probably be written like this in the earlier file:

href="#buccaneers">Abandoned Cemeteries

It will need to be amended to take account of the XHTML file in which the destination anchor is located; thus:

href="encantadas05.xhtml#buccaneers">Abandoned Cemeteries

Headings at the top of the Page

Start on New Page

InDesign has a paragraph style feature that can force text of a certain style to 'Start paragraph on new page'. Yes, all very well, but when exporting to ePUB, this will be ignored unless you create a table of contents (on the paste board and not actually on the page), and set those heading to level 1. Then, when using export for ePUB ... > turn on 'Use First Level Entries as chapter breaks'. This will create separate XHTML files inside the ePUB package. However:

If you want to make sub-headings or full page illustrations also to start at the top of a page then you need to edit the CSS inside the ePUB package:

Locate the div or heading class for that style in one of the XHTML documents and then in the template.css file add the following rule:

page-break-before: always;

Table of Contents does not create TOC in the ePUB

Do not group the styles

This is a recently discovered issue; don't put styles (paragraph or character) inside groups. InDesign, does not seem to be able to construct the TOC for the ePUB properly when encountering groups of styles.

Image placement

This is really part of a common complaint by designers about the positioning of images in relation to text. When designers use InDesign to build page layout, then they are free to move graphics on to the page and make the text wrap around or stop above and start again below. Yes, it looks great and exports beautifully to PDF. But, the ePUB will probably look dreadful, the images will all be at the back of the book.

So, the first rule is that the images need to be anchored in the paragraph, where you want the image to appear. The truth is, though, that getting the images to be centered, or floating left or right, is something best left until to you can edit the files inside the ePUB package.

Even so, the usual method to centre a block that contains the image and its caption ie:

.pictureblock {

Does not work, So you will need:

.pictureblock {
text-align: center;

Of course, I have written here, pictureblock, as the class name of the div. But, you will be dissapointed if you believe that this is the result of naming the object style in the InDesign document. Sorry, but InDesign, seems to name this block group, so you will need to rename this to something more appropriate like pictureblock.

Then add the element style definitions for pictureblock in the CSS file.

You will notice that we won't need all those extra divs (generated style etc) that InDesign produces.

Posted on 07 Apr around 8am


Extra words from Paul Erdman:

Very nicely written summary of some of the CS 5 EPUB issues!  I came across your post as I was researching a presentation on EPUBs for the Portland InDesign User Group meeting on April 14. I’m also compiling a handout that lists issues, their workarounds, and whether or not they’re known to be fixed in the upcoming CS 5.5. Your post reminded me of the hyperlink issue—thanks! I also love the CSS workaround for arbitrary page breaks. I’ll put a reference for your blog in the handout. Check my website out in a day or two if you’d like a copy of it, I’ll have it posted there soon.

Posted on  04/14  at  02:56 AM

Extra words from Chris Jennings:

Adobe CS5.5 may address some of these issues. We need to wait and see at this point…

Posted on  04/18  at  09:14 PM

Commenting is not available in this channel entry.