View Full Version : Steps for creating an ePub from Indeisgn CS3

02-28-2011, 01:05 AM
Caveat: This is the way I do it, there are plenty of other and probably better methods, but I don't care, because it works for me :)

A working knowledge of InDesign. I will not be describing how to make a style sheet
InDesign CS3
TextWranger (or another text editor which saves as UTF-8 and supports regular expressions)
Dreamweaver CS3
Photoshop (or another image editor)

Tip: Every style change must have a style sheet applied to it

Create Character Styles for Italic, Bold, Bold Italic and so on for each element eg (Smallcaps, Dropcap), ID will strip out any nested styles you must apply the character style to compensate
Search for any Dinkus's and apply Paragraph Style "Dinkus" to it
Make sure all images which will float are made in-line and have a paragraph style "image" applied
Make sure all Bullets, Lists Quotes etc have the following Style Sheet naming convention applied eg. QuoteFirst, QuoteMiddle, QuoteLast. With the appropriate spacing applied and also a QuoteSingleLine, with space applied to both top and bottom. This applies to bullet lists as well Tip: InDesign WILL strip out empty carriage returns.
Delete all page numbers from Content page.
Delete all running heads and Footers. including folios.
Splits Document into separate Documents and create a book and insert files into it, ePub will apply a page break for each Document, so each time you want a new page then create a new document)

Check file in the Book for stray elements like Blanks at the start of Files etc.
Create a blank Cover file and name it "Front Cover" insert into the book at the start and place an image in if you don't already have the front cover pic any image will do, and resize to 600x860pixels and call it "Cover.jpg" (also do the Kindle version while you there resizing to 600x800pixels and label it "Cover_kindle.jpg") Tip: Double check the cover in Photoshop to make sure it's set to RGB
Strip out any Index file and backmatter adds
Export book to Digital Editions. (I like to use these setting below)

Unzip the sample.epub changing the name to

The folder Structure will look something like this:

File clean up
I like to replace the "Cover-fmt.jpeg" in the Images folder with the "Cover.jpg" I made earlier, also adding in the "Cover_kindle.jpg" to the images folder.

Open the Content.opf file.
This is what they will typically look like after the conversion.
You will notice that although there are only two images in the epub.
The Content.opf file duplicates these image for every xhtml file in the manifest section. You have to remove these except for one set. I like to keep the top set under the Cover.xhtml file
Tip: this problem is fixed in InDesign CS5
Once you've done that you need to:

start at the top you will need to add the following lines (because I don't like the way ID puts in certain things).

Firstly. In between the <metadata> tags

<dc:identifier id="isbn_9781234567890">978-1-2345-6789-0</dc:identifier>
<dc:title>Book Title</dc:title>
<dc:creator>Author Name</dc:creator>
<dc:rights>Copyright Author Name 2011</dc:rights>
<dc:format />
<dc:description>Blurb for the Book</dc:description>
<dc:subject>Humanities; sciences; social sciences; scientific rationalism</dc:subject>
<meta name="cover" content="my-cover-image"/>

The date, language, and Cover entries MUST be there, the rest is optional
Next in the <manifest> section

<item id="my-cover-image" href="images/Cover_kindle.jpg" media-type="image/jpeg"/>

This goes with the other images
Next in <spine> section

<itemref idref="cover" linear="no"/>

This replaces the Cover line

Then at the bottom, between the </spine></package> insert

<reference type="cover" title="my-cover-image" href="images/Cover_kindle.jpg"/>

<reference type="toc" title="Table of Contents" href="Contents.xhtml"/>

These two relate to the Kindle conversion.
Tip: If you don't have a content.xhtml file then remove the table of contents line

So you should end up with a file looking like this:

Save and close

The TOC.NCX file you can leave, unless you change order of the files, but if you had them set correctly to begin with then this will be ok.


Open the Template.CSS file in Dreamweaver.
Insert text below into bottom of the file

samp {
font-family: sans-serif;
.centerImage1 {
margin-top: 0%;
text-indent: 0%;
text-align: center;
.image {
margin-top: 1em;
margin-bottom: 1em;
margin-left: 1.2em;
text-align: center;
img {
max-width: 100%
p.float {
line-height: 1.20em;
font-size: 1.00em;
float: left;
clear: left;
text-align: left;
font-weight: normal;
font-style: normal;
margin: 0 0.5em 0.5em 0;
color: rgb(0,0,0);

In the code where it list the "p" styles (p.stylename). Add at the end of the font family line , serif; (or "sans-serif") depended on the paragraph style required, like this:

p.x-body-no-indent {
font-family: "Minion Pro", serif;
line-height: 1.30em;
font-size: 0.96em;
margin-bottom: 0.00em;
margin-top: 0.00em;
text-indent: 0.00em;
margin-right: 0.00em;
margin-left: 0.00em;
text-align: justify;
font-weight: normal;
font-style: normal;
color: rgb(0,0,0);

At the bottom of the CSS file you you see:

span.italic {
font-weight: normal;
font-style: italic;
span.bold {
font-weight: normal;
font-style: bold;

Tip: the span.bold and span.italic entries could be blank, so you will need to add the required information above

span.hyperlink {
color: rgb(0,0,255);
text-decoration: underline;
span.strong {
font-weight: bold;
font-style: normal;

span.dropcap {
float: left;
font-size: 2.6em;
line-height: 0.9em;

Now you are ready to start opening your xhtml files in Dreamweaver.
I open the Cover, Title page and any other file with a full page image.
I select the image and set the max height to 100%

I then move onto the Chapter files and go though each one, to make sure nothing strange has happened and everything is where it should be.

Next, I open the contents file, and set up my TOC linking (I didn't bother with it in InDesign because the process is a real hit and miss PITA. It's much easier and faster IMO to do it from here.)

All you do is select, say, Chapter One. In the "link" pallet at the bottom, click on the Folder icon and choose Chapter_01.xhtml.
And that's it...Rinse and repeat for the remaining chapter entries in your Contents file.
To link you chapters BACK to the Contents.xhtml file, then you need to open each chapter and select the text you want the hyperlink to be on, in this case it's Chapter One. Click on the folder icon next to the "link" window at the bottom. and select the content.xhtml.

Once you are happy with what you have, then you need to compress the epub folder back up.

I do this by dragging the folder onto an Applescript which you can find here:

Once you have the filename.epub
I go to the three press website and run it through the validater

Ok. I think that's it.
This is just a guide on how I make epub files from InDesign CS3.

It is NOT to start a debate on the the quality of the CSS code as it is what InDesign generates and for that reason I've left it as is...

I hope people will find this useful. If I have made some glaring mistakes, please feel free to let me know and I'll fix up my post.

02-28-2011, 03:56 AM
That's a damned expensive way to create an ePub book! InDesign, Dreamweaver, Photoshop? How much is that little lot going to cost someone?

02-28-2011, 04:06 AM
If theys have InDesign CS3 there's a good chance they will have the CS3 package which include Photoshop and Dreamweaver, But as I mentioned this is how I do it.

02-28-2011, 05:37 PM
And, if you're a publisher who is already using ID for the print version, it is desirable to be able to create the epub (and other formats) from the same ID master files that contain all revisions, etc.

02-28-2011, 10:25 PM
And, if you're a publisher who is already using ID for the print version, it is desirable to be able to create the epub (and other formats) from the same ID master files that contain all revisions, etc.
Which is the case where I work st_albert. The books are already Quark and InDesign.
Nice work Marcus. :thumbsup: This should help a few InDesign users.

A bit more about adding the metadata to the InDesign file for export to ePub. If anyone was wondering how it is entered - here's how. After creating the chapter files and adding them to a new book. Select the file you created all your paragraph and character styles from the book window.
With that file open select FILE INFO from the FILE menu and add the title, author, copyright data etc. It will export that data to the content.opf file in the ePub as metadata. As mentioned above you'll need to edit the <dc:date /> because CS3 & 4 don't have a field to enter it and the ePub wont validate without it.
Ensure your source file with the info and styles in it has been checked in the style source box in the book window before exporting.

02-28-2011, 10:45 PM
A bit more about adding the metadata to the InDesign file for export to ePub. If anyone was wondering how it is entered - here's how.

Nice one Wannabee...:D

I left that out on purpose because, as I have to edit the date field in anyway, I just have a dummy text file sitting on my desktop with all the generic copy and paste info ready to go...

Hopefully what I wrote is not too confusing?

04-13-2011, 12:45 PM
Great post this was really helpful, thanks! Was wondering if you had any experience with exporting picture sections? I'm working on some books with picture sections now and after I export the book to digital editions the pictures get pushed to the front of the book and the some/all of the chapters are missing. If anyone has any advice about this I'd love to hear it! :)

04-14-2011, 01:19 AM
Hi Fiona

I think this attachment can explain it better than I can.

Another tip. Existing books might have artwork created in the inDesign file with vector tools etc which will be discarded. Zoom in on the existing art with high quality display on and do a screen dump and work with that.

Oh! Welcome to the forum :)

04-14-2011, 03:41 AM
I'll have more time tomorrow to explain how I do it...

I'm assuming your image section is in ID?

04-14-2011, 05:10 AM
Hi Mark, thanks for the attachment and for the welcome so glad I found this forum!

@Adjust, Yeah my image section is in ID CS3, if you have any tips that would be great! :)

04-14-2011, 09:51 PM
So basically when I get an illo section to do, it's in a separate ID document.

InDesign CS3
And looks a little like this:

You then need to, if you haven't already, apply a caption Paragraph style the caption text...

Then. All I do is rearrange the caption boxes to be underneath the photos.

And then group Photo box with the Caption Box.

That's it.

Export to digital editions:

Open the both the Contents.opf files of the newly created illo Section and the eBook .opf file the illo section is going into.

And just copy the Image information inside the manifest section, into the main OPF manifest

Open the illo section .CSS file, and insert the page break line to the caption style.
Then copy it into the "book" template.css

Then open the illo .xhtml file. and cop and paste all the stuff inside the <body></body> tags, and past it where you want it to go inside you book .xhtml files...

So after a bit of fine tuning the code you should end up with something looking like this:

And from the design view:

I hope this all makes sense.

04-14-2011, 10:15 PM
@adjust - Excuse me if I've missed the bleedin' obvious but why wouldn't you just keep the illustration sections in the same document as the rest of the book so you don't have to cut and paste the manifest etc?

04-14-2011, 10:35 PM
@adjust - Excuse me if I've missed the bleedin' obvious but why wouldn't you just keep the illustration sections in the same document as the rest of the book so you don't have to cut and paste the manifest etc?

Illustration sections are printing separately to the text. Usually on a 4-Colour press and on different paper stock. They are done in either 4, 8, 16, 32 page section. This means it can be bound up anywhere they want to put it in the book.

It also gets printed at different times, hence the need for a separate, ID Document.

Why I didn't include it into the ID "Book" as a separate file and call it Pic section?

It's because my clients want it to appear as close to where it falls in the printed edition as possible. This mean that it needs to go inside a chapter. As pic sections very very rarely fall in between chapters.

04-14-2011, 11:13 PM
OK, I get that. However, I would have opened the colour picture file, which you have shown us above, and copied it all and then opened the chapter you need to insert them into and paste them into the correct location of that chapter? The last page text box will overflow. You know how many pages you just pasted so add that many pages to the chapter and Bobs your uncle.

I'm not telling you how to suck eggs Marcus but wouldn't that be easier than your work-around mate?

04-15-2011, 12:08 AM
No you are correct. In my case I never get both text and illo files at the same time, so I have to do both separately.

You would still have to Group the images to the captions and then copy and paste them into the main text thread to ensure they are in the correct position after epub conversion.

I find it easier to manage to do it this way...

04-15-2011, 12:10 AM
No you are correct. In my case I never get both text and illo files at the same time, so I have to do both separately.


04-15-2011, 12:58 AM
Meh...kind of works out better that way... then the client can move the pic section around before I do any work to it...

04-19-2011, 08:35 AM
Thanks guys that was really helpful! :)

06-02-2011, 02:44 PM
Great procedure. Clarified a lot of things for me. Many thanks!



06-02-2011, 09:44 PM
I'm Glad that's helped you Allen, You'll find this site alot more informative and helpful then the Adobe Forums

06-03-2011, 09:49 AM
That's an understatement!