Tuesday, June 1, 2010

InDesign CS5 Creates Faulty Links in ePub

<strong>Update (3/Oct/2100): CS5.5 exports links from multiple chapters correctly! </strong>

I'd heard last week or so that InDesign's super new feature—the ability to break a book into chapters automatically upon export to ePub (embodied in the "Use First Level Entries as Chapter Breaks" option)—would make hyperlinks break.

What I found yesterday is that even if you're the one that created the multiple chapters, InDesign still creates faulty links.

If you open up the generated ePub, you'll find that all of the links created are just URL fragments, that is, there is no reference to a particular book file, only the anchor reference to a particular place in the current file:

<p class="author" xml:lang='en-us'><span class="small-caps"><a href="#economy-anchor">Economy</a></span></p>

This is a little like sending a letter to someone on 456 Main Street without specifying which town they live in. It's not going to get there. The result is that only links within a single InDesign file will work.

I've heard there's a guy in the Netherlands who's developed a script to fix this problem, but really, shouldn't Adobe have done that?

In addition, I've found that InDesign doesn't export generated tables of contents to ePub at all. They simply disappear from the exported ePub (though they appear just fine in PDFs).

I am just amazed that this bug even exists, and that it hasn't been fixed immediately. InDesign is a great tool for creating ePubs but if it breaks all your links, that's pretty much a deal breaker.

Lindsey Martin reports that links in PDFs exported with Interactive also fail. I find this amazing.


  1. My understanding is that the ToC thing isn't a bug, Adobe considers is a feature. eReaders want to display the ToC in their own format; exporting the text of this to an .epub file would be a waste. Instead, it puts the ToC *data* into the .epub file (in one of the XML files lurking inside every epub... I believe the file uses the .ncx extension) and lets the reader dictate how it's shown to the user.

    FWIW, Adobe is aware that many folks find this frustrating, and seem amenable to fixing it.... eventually.

  2. Any idea why CS5 adds xml:lang='en-us' to every paragraph? Seems like a lot of redundant code.

  3. @David No, no idea. Indeed, iBooks doesn't recognize the language chosen with xml:lang (it uses the dictionary specified in the content.opf file with dc:language). I use grep to get rid of xml:lang='en-us'.

  4. @David: It's somewhat for Adobe Digital Edition. In the past, Chinese (or maybe plus Japanese) didn't tag with xml:lang='zh-hk' or xml:lang='ja-jp' couldn't be recognized by Digital Edition. But was fine with other eReader. I don't know why. Isn't that what Unicode for?

  5. Liz, it's been a year - has this problem been solved?
    I'm having the same issue right now, so I'm wondering if I'm missing something.
    Thank you!

  6. @Francis:

    I just created a one-document book in CS5.5 which had extensive links and cross references. They all seem to be working properly. I have not tested multiple document books yet. I'll let you know what I find out.


More of my books