Exporting ePubs from InDesign

In the next couple of posts, I hope to give you an idea of what works well with the ePub export, how to get better ePub documents from InDesign, and what sort of documents would work better as a PDF. To that end, I thought I should start with giving you some background on what an ePub is and how the Digital Editions export inside InDesign works to create ePubs.

You may be aware that ePub is really made up of OPS, OPF and OCF, which are standards from the International Digital Publishing Forum (www.idpf.org). They build on other standards, including XML and XHTML. This means that the pages you’re seeing in Digital Editions (when you export an ePub from InDesign) are XHTML. They have xml structures around them to aid navigation and presentation, and a package that wraps it all so that the many files are a single item on disk. Still, they are essentially XHTML and CSS, and that means they have certain strengths and weaknesses.

In building the current version of the Digital Editions export into InDesign, we made the decision to focus on book formats that lend themselves easily to automated layout – that is to say, narrative books where readability is important but the view of a double page spread or of a single page isn’t a priority. Still, the XHTML nature and the focus on narrative books means that certain items won’t be preserved when exporting ePubs from InDesign.

There’s no support for putting text on a path in XHTML. When you put text on a path in InDesign that text would need to either be rendered as a graphic, or it looses the path. For CS3 we decided not to export the text as a graphic, so the ePub export preserves the text, but not the path, so that the text is still text in the XHTML. The same is true for text that is set at an angle. If you create a text frame in InDesign, and then rotate it a few degrees one direction or the other, the text will still be exported as XHTML, rather than choosing some other format. This means that the rotation is not exported, just the text. Of course if you have a document that uses these features, they’re preserved perfectly when you export a PDF and open that in Digital Editions.

13 Responses to Exporting ePubs from InDesign

  1. Preston says:

    Thanks for the tips, Paul. Out of curiosity, how are things like sidebars or other items outside the main flow handled during export? Are they anchored to a nearby paragraph?

  2. Paul Norton says:

    Hi Preston,The short answer is that sidebars and other items outside the main flow will fall either before or after the main flow in the exported document (as if it was part of the main flow, but came before or after.) The placement of those items depends on where they are in reference to the first frame for the main flow. I’ll try to post the details in an entry this week.

  3. Magdalena says:

    Normal page breaks don’t seem to be supported in the ePub-format exported from Indesign CS3?I have tried both as a paragraph style and by inserting a break character.

  4. Paul Norton says:

    Hi Magdalena,That’s correct, the page-breaks don’t make it through the conversion.There’s a work-around, but it doesn’t work in every situation. The work-around is to use the InDesign book feature (and TOC feature) and have a new document for each place you want a page-break in the book. Works great if you wanted page-breaks to start chapters, but it can be a pain if you really were going to introduce a lot of page-breaks.

  5. Gurubaran says:

    So, Can I take it in this way, ePub format from Indesign CS3 can be upgraded in mere future to meets idpf standard ePub format for whatever the complex file exported from Indeisgn?

  6. Paul Norton says:

    Hi Gurubaran,The EPUBs exported from InDesign can in some cases comply with the IDPF standards, but won’t always be compliant.The factor that affects compliance is actually the options one chooses during export.If you choose to export the original images (as opposed to converting them to JPEG or GIF) then you’re likely to have files in the document that no reader supports. TIFF, for example, isn’t supported by EPUB and therefore not supported in Digital Editions.If you choose optomized images and if the document has the proper metadata (so that it can be included in the EPUB) then the document InDesign creates should work with any reader that is compliant with the IDPF standards.

  7. Richard says:

    Hi Paul,Is there some kind of work around so that when you export to epub it uses the TOC in the the InDesign file to generate the bookmarks/TOC that appear in the epub file? It seems a little crazy not to offer this functionality given it couldn’t be all that hard to develop.I’ll explain why it’s so essential to me.I’ve spent an enormous amount of time designing a set of classic books which I publish on http://www.planetebook.com and give away free to people. I’m able to use the functionality in InDesign to create a perfect set of bookmarks for all sections and chapters — all within seconds.Now imagine that some of the books I’ve designed have 100+ chapters in them. Am I really expected to go and make a separate InDesign file for each, combine them into a book, and then export to epub? That’s way to much work to contemplate. Really, from my perspective (because the books are quite simple and just pure text) there’s little need for there to be one InDesign file per chapter.Seeing InDesign export nicely to PDF and not do the same thing to epub is pretty disappointing, as I could so rapidly have a bunch of free books out there for people to read in Adobe Digital Editions.It would be really nice to build this extra functionality in there for users like me.Anyway, I’m hoping I’m mistaken and there’s an easy solution to my problem. I’m really pleased about the additional exporting support in InDesign CS3 but this lack of functionality is a showstopper for me.Thoughts?

  8. Paul Norton says:

    Hi Richard,Well, it depends on what sort of TOC you want in the EPUB after export, but as long as you’ve updated your InDesign CS3 to version 5.0.1 or later you do, in fact, have that feature.With the latest version of the plug-in you’ll see 3 panels on the left side:”General””Images””Contents”Of course it’s that third panel that you want.The “Include InDesign TOC Entries” check box will turn on the feature and let you choose a TOC style and use it for the EPUB TOC. There’s an advantage to that in that you don’t have to use the same TOC style for the PDF and for the EPUB, although you can. By the way, the only thing the EPUB export takes from the TOC styles is the hierarchy of Paragraph Styles.Now, when the TOC is generated, it’s generated as the navigation information for the EPUB document. The TOC doesn’t show up as a chapter of the book, but shows up in the navigation panel in Adobe Digital Editions.Ok, now even with the ability to add the Table of Contents in, I’d still recommend chunking the books into multiple pieces, usually chapter size pieces. The reason for this doesn’t really have to do with the TOC, it’s more to do with memory management and not being a resource hog on mobile devices. When you open a book, there’s a lot of stuff a reading application can do for you, it will layout pages of text, find book marks and hyperlinks in the text (like, say if you are using footnotes in InDesign) and so the book isn’t really treated so much as one long string of plain text as it is the content of a book that needs to be paginated on the fly and managed. Now, how much goes through this process of pagination depends on the size of the chunks within the EPUB. If you have one really long chunk that is a 100+ chapter book, then we’re going to have to paginate that whole thing at once.The issue really isn’t anything you’d ever see as a problem on a desktop PC, but on a cell phone or other handheld device a single book all as one XHTML file isn’t a good use of the resources on the device.Paul

  9. Richard says:

    Paul, thanks for the detailed response. I was in fact using 5.0 so the functionality wasn’t there for me. I’ll give a newer version a try.Thanks for explaining the reasoning behind it. I guess from my perspective it would be great if InDesign could just automatically break up the file into a set of XHTML files (based on the TOC) as it still means I have to break the book up into chapters manually — if I want to make the ideal epub file.If I have to do that then realistically I’m not going to publish epub versions as it will take me way to long.It’s absolutely fantastic having the ability to publish both PDFs and epub versions from the one InDesign file. Having it as automated as possible would make my job so much easier. I’m not sure if what I’m doing is all that common and warrants being consider for a future InDesign release, but I sure hope so.

  10. Scott says:

    Hi Paul,We’ve recently made the switch to InDesign and utilize the built-in XHTML Digital Editions Export perhaps hundreds of times a week. The settings we use remain the same from one use to the next and as you can imagine, producing that many exports becomes tiring as a manual process. I’ve been asked to try and automate this completely if possible. Yet the script being a binary javascript is unreadable. What I need is to either have access to the part of the script that performs the actual export functionality without the UI (using our own fixed format) or gain at least an understanding of what steps the script utilizes within InDesign to create the export so I can then create an applescript to achieve the same result. Where can I find this information?Thanks so much!Scott

  11. Gina says:

    Hi Paul,I am new to creating epub files from InDesign. I have InDesign CS3 and a trial version of InDesign CS4. I am having the same problem with both versions. I was given an Indesign file to be exported to an epub file. So I made sure all the text was linked to a paragraph style, each different style of text linked to a single Paragraph style. When I exported my file and opened it up in ADE none of the styles were held. No matter what I checked in the export box, nothing seems to be holding my text styles. What am I doing wrong?I have include embeddable fonts checked and if I check local formatting or defined styles, the fonts don’t appear as they should. If I check style names only, all of the text in the epub file has lost all of it’s styles.Can you tell me what I need to do? My company is starting to produce epub files for kindle devices and I don’t know how to get the inDesign files to export properly.

  12. Kelly Vaughn says:

    I am a print designer, but I also create interactive manuals. Our only output right now is PDF, but I am interested in ebooks and digital editions. I have often wondered how to view the file after I have exported it from InDesign. Perhaps there should be an (easy to find) intro somewhere on this blog that tells people what digital editions/epub documents are. And even better yet, a link to the ADE page on the Adobe website. I found the Digital Editions download, but only after another user mentioned ADE in a blog post. ADE is a very well kept secret. Let’s get the word out.

  13. Heather says:

    I can’t get epub or any other format to work so that I can send an e-newsletter. I keep getting error messages when I try and open the document. Is there something specific I have to do?