Export scenes to EPUB3


I created a poem with animations using PubCoder.
It's called "Unfold My Heart" and it can be downloaded from my web page:

I created the same poem with TH and I would like to know how I can turn the file into an EPUB3 document. I opted for a sequence of scenes, each one of them containing an animation.

Can I export the file with all the scenes or should I create a widget for each animation?
Can I can use Pages or InDesign or both?

Thank you for your help


If you want them to be individual book pages as you have them in the epub, then you'll want to export as individual scenes if possible, and then import them individually.

However you don't mind them all being on the same physical page (but maybe using Hype's own page turn/swipe gestures to change), then you could export as a single animation.

So I guess it really depends on the type of interaction that you want.

I will try the first option and export the animations as individual scenes, and then import them individually.

I guess, first I need a button to start the timeline.
Do I have to create the button in TH and export the animation and the button as one widget?

I have two options for the button:
I can use the last verse of the strophe as a button (screenshot below).
Or I can create a button that is as large as the screen.
How can I do the latter?

I managed to program the UFM_button to start the animation of the heart.
I hope I did it right.


Note While Hype's File > Advanced Export does have helpers to let you export each scene individually, it can't currently be combined with the OAM Widget export (which is most likely how you'd get them into InDesign). This means you'll need to copy and paste the scene into a new document if you're going to use this export method.

The Main Timeline always starts by default, so you may not need a button for this unless you're explicitly pausing it on scene load.

  1. Make a new Rectangle element
  2. Choose the Arrange > Bring to Front menu item
  3. Remove all styling (like the background fill and border)
  4. Add an On Mouse Click action to Start Timeline…

Hi Jonathan

I prefer to have a small button that triggers the action and the animation to be on pause when the page loads.

I want to learn this technique because I will need it for another project of mine.

I tried to do it.

I selected the main timeline and 'Pause Timeline'.
I created the button to start the main timeline.

Now, I can't combine the two actions. The animation doesn't start on a button click.

I had a look at the Advanced Export function.

I guess I have to use this function to export the whole widget and embed it in an InDesign document.



Start Timeline will always advance the playhead to the beginning. Since you have a pause timeline action, it is therefore always being hit and always pausing. Instead you can:

  • use a continue timeline action, which will play from the current playhead position (which would be past the pause timeline), or
  • Put the pause timeline action in the On Scene Load handler (in the scene inspector) so it isn't part of the timeline itsellf

You'll probably want the 'File > Export as HTML5 > OAM Widget…' for getting into InDesign. At least this lets you drag and drop into a document pretty easily.

If you used Advanced Export then you'd just get the raw HTML and resources, which you'd need to figure out how to properly embed. (But if you have this working, then feel free to use this technique).

Wonderful! It worked!

I put the pause timeline action in the On Scene Load handler.

I exported the widget and embedded it in an InDesign document.

Then I exported the new file as an EPUB fixed layout.

On Books I can click on the button and the heart opens up.

I can now proceed with the other pages.

On the last page, I want to embed a YouTube video.

I will use the HTML widget to do that.



Almost done.

I embeded the widgets in InDesign and exported the document in EPUB3 format.
It's online now with the title "Unfold My Heart 2": EDGE DPUB - Unfold My Heart

The layout of the last 3 pages is faulty and the video is not visible.
Also, in EpubCheck I get the same error for 10 files. It is related to the iframe, but I don't understand what it means.

Thank you for your help.

Hmm, I assume you meant the youtube videos?

It might be that internet access is being blocked somehow, at least in the Apple Books app that I'm using to test this. Usually it prompts if I want to allow Internet Access for the book, but I did not get this for yours. Maybe there's some flag that needs to be set somewhere?

Worst case is that you can include the video file itself in the book as a Hype element.

I'm sadly no expert either, but they don't look like catastrophic failures.

In the file iframe-htmlwidget.html the editor showed that I had to add at the beginning of the iframe.
It now reads: Element "head" is missing a required instance of child element "title".

I suppose I have to add < head > </ head > somewhere.

You don't really need to; I doubt this is the issue. Any browser (and thus reader that uses a browser engine) will be okay with non-strict HTML code.

What epub readers are you testing in?

I work on my iMac and I read my EPUBs with Books, Thorium and ADE.

To clarify, none of them show the youtube video?

It looks pretty bad at the moment...

Books doesn't show the video.

In Books I can only see the animations of the heart.

ADE doesn't show anything.

On every page, there is this notification

Thorium doesn't open the document at all.

A pop-up appears on the screen and I don't know what to do.

Hmm... would it be possible for you to send a zip containing the .hype document along with any InDesign or other files that you are using to make the document? I think I'd want to see how you're putting it in and try reproducing the creation. Thanks!


this zip file contains:

  • the hand-drawn illustrations of the heart to create the animations
  • the InDesign document with the widgets (I copied and pasted them from TH)
  • the widgets and the OAM files

Looking forward to seeing your version.

UFM_test 2.zip

It looks like this was not public so I put in an access request.

Just to be clear. Is there anything I need to do on my end or should I wait?

It still says I need access; I assume you would have gotten an access request from me that you need to approve? Once you do that, I should be able to see/download the file.

Got you.
I have just shared the file with you.

1 Like