How to Get Animations to Work in a PDF

David writes,

I’ve been banging my head against a wall all day about using an animation inside a PDF.

I make a frame and have it fly in from right, then export the whole page as SWF with transparent background. Now I delete the animation and place the SWF.  Next I put a background in and send it to behind the animation. I set the SWF to play on page load with no poster. Export as interactive PDF.

I thought for sure that transparent background meant, um, transparent! But it’s opaque for me. Why can’t I get this animated object to fly in over the background?

David is correct in thinking that setting a placed SWF’s background to transparent would be honored when you export to a PDF. Unfortunately when you open the exported PDF in Acrobat Pro or Adobe Reader the transparency is not honored. Luckily there is a simple workaround with Acrobat Professional. Just in case you are not familiar working with SWFs and transparent backgrounds inside InDesign, let me explain.

When you create an animation inside InDesign, you can’t just export your layout to an interactive PDF and expect your animation to work. In order for an animation to work in a PDF you need to export your animation to a SWF, place it back in the layout and remove/hide the original. After placing the SWF in your layout use the media panel to control the placed SWF file.  Set the poster to none and play on page load and. Now you will be able to play back the animation with a transparent background in your layout by using the preview panel.

InDesign Media Panel

After exporting to an interactive PDF, you would expect to see a PDF that will play the animation as it did in your layout. Unfortunately, you will see the dreaded white background.

The reason that you are seeing white instead of your background is that InDesign does not render the embedded the SWF file properly inside the exported PDF. You need to edit the placed SWF file with Acrobat Professional. Using the select object tool, double-click the placed SWF file to bring up the SWF options. Check the “transparent background” checkbox and now your PDF will play as expected.

I wish this simple workaround was not necessary, but at least there is a solution. Hopefully at some point in the future the Acrobat and InDesign teams can work together to solve this problem.

Tags
Related Articles
Comments

15 Comments on “How to Get Animations to Work in a PDF

  1. I’ve tried as you’ve suggested above with the transparent background, but it is not working for me.

    What’s happening is that I can get my interactive pdf to do everything it’s suppose to in Acrobat, except display correctly. It displays with the white box around the edges, thus moving the art so that it’s cutting off its edges when I have “fit for page” or “fit for width” selected. It won’t show the art in its entirety and when I go to zoom out, it shows a larger black box that overtakes the art, and doesn’t change the actual size of the art itself.

    I hope this makes sense. Can anyone help?

  2. Maureen,

    That is strange. Here is another suggestion.

    1. Inside ID select the animation and export it as a SWF.
    2. Export your layout to an Interactive PDF without the animated content.
    3. In Acrobat Pro place the SWF content with the Flash tool.

    Does this solve the problem?

  3. Hi there,

    I’m using the script to get my animations and interactive SWF content into an interactive PDF. Everything is working great except, where I have a swf file created in Flash, placed in InDesign, and set to play with mouse up on a button. When the button is clicked the space where this placed swf file is just goes blank.

    Any suggestions would be much appreciated.

    Thanks,

    DP

  4. @David

    A SWF created from Flash should work in InDesign, however what version of ActionScript did you use to create it? AS3 is what ID uses, and if you used an older version that might be causing the problem.

    Be sure that the swf file is above everything, if there is transparency above the swf, the interactivity could be lost.

  5. Hi James,

    Thanks for your reply. I’ve checked and I am using AS3 so I don’t think that is the problem.

    It may be the transparency issue you mentioned. The swf in question sits within a small area of the page. When I originally placed the file into indesign the animation that extended off the stage in Flash was still visible, so I created a solid white compound shape with a space cut out of the middle of it the same size as the flash file so that this hid any animation happening outside the boundaries of the stage.

    In my layers palette in indesign I have a number of layers that are above the swf in the layer order, some of which involve transparency. Although these layers are above the swf in the layer order, they are not physically placed on top of the swf on the page.

    Do you think having layers with transparency above the swf in the layer order (but not on top of the swf on the page) would be causing the problem?

    The button I set to play the swf still has interactivity as it manages to fade out other items, it just doesn’t play the swf correctly that i can see.

    Thanks for your help on this,

    David.

  6. I’ve now made the SWF produced in flash and placed in the InDesign file masked so that no objects show beyond the boundaries of the stage.

    This enabled me to get rid of the white compound shape that was above my SWF in InDesign, and I’ve made sure that the SWF file is on the top layer and there is nothing above it. Unfortunately my swf is still not playing when the set to play it is released.

    Any further suggestions as to what could be causing this problem would be much appreciated.

    Thanks.

  7. Hi James,

    I’m using the script to get a placed SWF file (animated content originated in Flash AS3) into a pdf. When I generate the interactive pdf, the animated portion of the page does not show up. I double checked the script-generated swf page by running it in flash and everything shows up. In my ID file, the placed original animation swf file is on the top layer.

    It does work when I do it the “work around way” but I’d like to figure out how to make the script way work too.

    Any suggestions?

    Thanks.

  8. There is another method that you can try.

    Create all of the animations inside InDesign and export the entire layout as a SWF.
    Next, open Acrobat Pro and go to file > create PDF and browse to the SWF file.
    After creating the PDF, select the swf file and change its properties to play on page load.

    I will be writing this up as a new post soon.

    Good luck!

  9. Hi. I am using the swf-presenter script in indesign. When i finally export to a interactive pdf, acrobat pro shows first a blank screen up (maybe 0ne second), then jumps to the animated page.

    Can i fix this in some way?

    Thx

  10. Hello I am having the same issue as Maureen Olm. Or atleast a similar one. I export my entire INdesign layout as a .swf then place the .swf into a new INdesign doc and export it as an interactive pdf. I’ve tried it with and without every option in the export dialog box and every time the end result is the same. I get a fully functional file with about 1/4 inch or less white border around it (or maybe it is an extension of the file itself. Though my doc .swf and all it’s content fit within the size of my doc. – no bleeds). AND if I zoom in on this file in acrobat it makes the white “border” get larger – it grows to 2 or 3 inches all the way around. I would love it if someone know how to get rid of the white border and fix the width so it can’t be zoomed in and out like that. PLEASE HELP!

  11. Hey Its working very nice i tried with InDesign 5.5 and its working, i just created one document using some animation effect and export as swf and then i placed it in to Layout and Export as Interactive PDF. hurryaaaaaa… its working..
    Thanks
    Tushar

  12. Hi everyone. I am having an issue with my swf file not playing properly. I placed an swf file into one of my Indesign pages. Then, I export the Indesign file as an interactive pdf. What I want, is for the swf file to automatically play when I reach the page that it is on (or on page load). However, what’s happening, is that when I get to the pdf page that the swf is on, there is just a generic image for a swf file and it says “click to activate”. When I click it, it plays. But I want it to play on page load, automatically. And I don’t want there to be that ugly swf icon. All I want to see is my animation.

    I just want to add, that when I place the swf file into Indesign, in the animation menu, the “event” options are grayed out, and it defaults to “on page load”. Which is what I want, but it’s not playing on “page load”, it waits until I “click to activate”.

    • Hey Hi kelly its just you need to enable “Play on Page Load” option from “Media” palette, Which is in Windows > Interactive > Media > here you can see one checkbox which must be not be checked on so you just need to select your swf placed in the document and mark checkbox on, and then go for your exercise.
      Best luck!!

  13. I need an animation on a page where a box pops up when clicked. I’ve gone through the steps – creating the animation, exporting as swf, placing that, then exporting the PDF. The animation seems to work okay in Acrobat, but when I want to go to the next (or previous) page, it doesn’t work properly. I have to press “page down” several times, then it sort of freezes up and eventually goes to the next page (or even further because I’ve pressed it many times waiting for something to happen!). What am I doing wrong?

  14. Ever wondered why adobe never allowed animated gifs in their pdf documents?
    I don’t know, but a very credible hypothesis is that they think of animated gifs as “1980s technology”. Instead, their “brilliant” work-around is to let people add movie players to their pdf documents (Flash files for example).
    The results of this “brilliant” piece of thought are:

    - A 10 page document with 5 small animations could be as large as 100 MB or more (instead of less than 1 MB using animated gifs).
    - Many devices will not be able to run the animations.
    - Devices which would normally run animations can’t do so because… the file is too large!! lol.

    The irony of all this is that Adobe no longer wants to support flash. Why? is it because there is a technology which can replace flash? well… er… no, not really. HTML 5 will take at least another decade to reach the level of flash. Why then? well… rumour has it that it’s mainly because Steve Jobs said that “Flash sux”, and you know who the best paying customers of adobe are, right? Yeap, apple users.

    Animated gifs are perfect for educational documents where a small animation can make life so much easier for a student to understand a concept or idea (not to mention how much more interesting it is to read some documents which include animations).

    When a simple html file can offer a better educational experience than a pdf file, you should bloody know that you’ve done something wrong!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>