May 26 2010 • 2:13 PM

Bringing Animation from InDesign CS5 into a PDF… with the help of a little script

Recently during the InDesign Secrets Print and ePublishing Conference, there was a fun event called Ignite InDesign where attendees to the conference (including a few of the speakers) gave 5 minute presentations with a slide automatically progressing every 15 seconds. Auto-advancing slides can be quite entertaining for the crowd when the presenter loses track of time and forgets which slide they are on. To create these presentations you could use PowerPoint or Keynote, but this is InDesign Secrets that we are talking about here and we want to use our favorite program.

CS5 has a lot of interactive tools are a lot of fun to use (as seen in Mike’s earlier post), and I wanted to use them in my presentation. My presentation was called “My Favorite Podcasts” and each slide mentioned the name of a Podcast, the album art and a few bullet points about the show. Rather that have normal static presentation, I used the new interactive tools to really have fun with the presentation. After experimenting I was able to successfully export it to SWF, but there was a problem. A SWF will not auto-flip (per the rules of the presentation) without some ActionScript code in Flash Professional and I don’t want to learn ActionScript.


Click the image above to watch the SWF

Using a PDF

A simpler solution was to export to PDF and just run the presentation full screen in Acrobat Pro/Reader. As simple as an approach like this might seem, it didn’t work like I thought. When you export your working InDesign file to a PDF the animations to not work. You are stuck with whatever is static on screen and the results are not very desirable.

The Manual Solution

In order to get the SWFs to play in your PDF you have to export each individual page out as a single SWF and then place it back into InDesign. I highly recommend that you place them on their own SWF layer. After the SWF’s are placed back in the layout you just have to turn the original design layers off and keep the SWF layer on. Now you can export your presentation to PDF and view the animations. If you need to make any changes to the presentation just turn your design layer back on, make your edits and export a new SWF of that page and replace the existing SWF. Your links panel will list a modified link, just update the link and export a new PDF.

Note: Placed SWF’s will not scale inside the PDF therefore it is important to design your layout at the final output size for your presentation.

Scripting to the Rescue!

Exporting each page of a 20 page presentation one at a time to a SWF and then manually placing each SWF back into the layout on its own layer is not fun. I did it for 20 pages just to get it done, but what if my presentation was 50 or 100 pages? I thought that scripting seemed like a perfect solution.

During the Conference I had to chance to meet the brilliant Martinho da Gloria from automation.com who wrote the amazing Layout Zone script. I talked to him about the problem of manually exporting each page to an individual SWF and then placing them back into the layout on a new layer. He agreed that scripting was a viable solution and was quickly absorbed in the problem. A few hours later he had finished his SWF Presenter script which automatically exports each page to a swf and places them back into your layout on a new layer.

When you first run the script it will ask you where you would like to save all of the exported SWFs. I generally make a SWF folder inside my links folder for them. Next, the script will then prompt you with the SWF export options. When you click OK the script will batch export each page of the layout to and then place them back into the layout on their respective page. Now you can turn off the original design layer and export your layout with the placed SWFs to PDF. Update: After the script places the SWF on each page, each SWF is set to play on page load.

Downloads

The SWFpresenter script can be downloaded here.*
*updated to version 1.01

In case you are interested in all of the podcasts that I mentioned in my presentation you can download a PDF of them here.

30 Responses discussing this post. Add yours below.

  1. Mitch Osborne
    May 26th, 2010 • 3:00 pm • Link

    Maybe I missed something, but when did InDesign Secrets become a paid subscription site?

  2. May 26th, 2010 • 3:28 pm • Link

    @Mitch,

    InDesign Secrets is not a paid site. What makes you think that it is? We offer a free subscription service which lets you receive a newsletter and post in our forums, but I am not aware of a paid service.

  3. Steve Werner
    May 26th, 2010 • 4:09 pm • Link

    James,

    If you Log Out, and try to view this post, you’ll get the message that this posting requires a paid subscription! I’ve never seen that before. Try it.

  4. May 26th, 2010 • 5:21 pm • Link

    The post is now fixed and everyone should be able to see it. Somehow in the posting setup options there was an option to restrict posts which must have been checked by accident.

    I apologize for the inconvenience.

  5. May 26th, 2010 • 5:23 pm • Link

    James, Don’t do that again! ;-) I mean checking the option when posting not writing. You can write as much as you like….

  6. Mitch Osborne
    May 26th, 2010 • 5:28 pm • Link

    Glad it was nothing more serious. I’ve been reading the site since CS2 and was surprised by the message. I was concerned it might be an offsite hack. Happy it was just an errant check box.

  7. May 26th, 2010 • 10:26 pm • Link

    There is so much valuable information here, there are people taking time to test scripts and features and write articles, that even if I had to pay a little fee I would gladly do it because this little fee helps me save thousands of money.

  8. Eugene Tyson
    May 27th, 2010 • 1:56 am • Link

    So they knew that animations couldn’t be brought to pdfs, but it only took someone a couple of hours to write a script to do it.

  9. Simon Kemp
    May 27th, 2010 • 4:26 am • Link

    Hi,

    Thanks to Martinho for this script.

    I am in the middle of creating a Presentation using InDesign CS5 and have already come across the limitations described and have been doing the manual exporting each page as a SWF and placing back in again.

    However, the script does not apply the “Play on Page Load” setting found in the new Media panel and also assigns the Standard Poster artwork when placing the SWFs back into the document.

    This means that I have to click on the Flash icon to activate the animation on each page of the PDF.

    I cannot seem to set a default as all settings in the Media panel are inactive without some Media selected.

    Unless I am missing something in either InDesign or Acrobat.

    Still a useful script though and will save a lot of time.

    Thanks,
    Simon

  10. May 27th, 2010 • 6:11 am • Link

    @Simon,

    Great suggestion “Play on Page Load” for the placed SWFs. I will pass on this improvement to him.

    Regarding the poster artwork, why do you need to set a different poster for the SWF if you are having it play on page load? I would only want to have a poster if the animation was not going to happen immediately.

  11. Jennie
    May 27th, 2010 • 6:51 am • Link

    I’m with Branislav. The information from this site has saved me so much time, head scratching, and frustration.

  12. Jennie
    May 27th, 2010 • 6:52 am • Link

    Did the edit button disappear, or is it because I wasn’t logged in when I made the last post?

  13. Eugene Tyson
    May 27th, 2010 • 6:58 am • Link

    Edit button went a long time ago – I don’t know why *cries*

  14. Simon Kemp
    May 27th, 2010 • 7:58 am • Link

    @Fritz,

    Good point.

  15. Graemezee
    May 27th, 2010 • 1:43 pm • Link

    Have been investigating interactive pdf’s for awhile now there are some great site on rich media content but its seems to be a small community and they keep their secrets quite close. I was hoping to use swf as button links in pdf although possible its is quite complex you need As3 and javascripting capabilities. One of the problems with swf in a pdf is they do not print ( again solvable with AS3)

    My work around is to make the presentation in IDCS5 export to Flash make simple but interactive swf one file.
    Go back to inDesign make a simple title page export the whole document with the title page, to a normal screen res pdf import the swf to the first page. set document to open in full screen mode with no navigation.

    whole presentation is on page one but if you print the pdf all the subsequent pages print looks to all intent and purposes the the interactive document has printed.

    Not perfect but with limited flash skills you can make impressive presentations without being a coder.

  16. May 27th, 2010 • 1:48 pm • Link

    @Graemezee,

    Regarding your printing question. If you design your presentation in ID with the original design on 1 layer and the placed SWF on the other, when you export your PDF to an interactive PDF be sure to include acrobat layers.

    When you have the PDF open you can run the presentation with the design layer off and the SWF layer on. If you have to print it, turn the SWF layer off and the design layer back on.

  17. Graemezee
    May 27th, 2010 • 3:20 pm • Link

    @Fritz

    I was thinking about end users wanting to print the pdf. Many of my clients use interactive pdf’s, instead of brochures, they want the interactivity and the ability for their clients to print the document. swf files in pdf do not print and to explain to a clients client how to switch layers on and off in acrobat reader is a non starter. I know you can do much with swf AS3 and javascripting but in my limited experience it requires lots of skill and troubleshooting for limited gains. My original post seem to make more sense
    infinitely more interactivity, defined only by your skill in Flash. and a printable pdf Obviously the content generated in IDCS5 can be printed digitally or commercially dependent on the requirement

  18. May 27th, 2010 • 5:58 pm • Link

    @Graemezee,

    I see what you mean with it being complicated for the end users. Another simple solution would be to just export 2 PDFs from InDesign.

    1. The presentation PDF with the SWF animations
    2. The original design ready for printing

    Now it is dead simple for your client. They just choose which PDF that they want to use.

  19. Eugene Tyson
    May 28th, 2010 • 1:29 am • Link

    Isn’t it possible to make one thing visible in the PDF but not print, and then the other thing not visible but does print.

    So in this case, can you make the SWF visible in the PDF but not printable. But under that have the original design not visible, but set to print?

  20. May 28th, 2010 • 9:50 am • Link

    @Simon,

    The script was just updated to version 1.01 with the the placed SWF’s now set to on page load per your suggestion.

    Thanks again for your help!

  21. May 28th, 2010 • 9:53 am • Link

    @Eugene,

    That might be an option, but it seems like more work than just turning a layer on/off or exporting another PDF.

  22. Simon Kemp
    May 28th, 2010 • 12:13 pm • Link

    Thanks to Matinho.

    I should now be able to get my Presentation finished just before my 30 day trial ends.

    It has been fun creating animations and I have even had some nods of approval from the Flash users in the department.

    Hopefully I can impress the bosses enough for them to pay for the upgrade.

    Simon.

  23. Simon Kemp
    May 28th, 2010 • 12:15 pm • Link

    oops:

    Should have been Thanks to Martinho, with an R.

    Simon.

  24. May 28th, 2010 • 4:53 pm • Link

    @Fritz — something that might be even simpler for the end user rather than two separate PDFs… Combine the two PDFs into a single PDF Portfolio. User receives a single PDF file. When they open it, they are presented with two thumbnails, one for the “print” experience and one for the “interactive” experience.

    For those of you who haven’t seen PDF Portfolios yet, check out the samples here:

    http://www.adobe.com/products/acrobat/pdf_showcase/

  25. Eugene Tyson
    May 29th, 2010 • 6:17 am • Link

    @James

    I think them receiving 1 pdf would be better for the end user. I’ve set up PDFs with printing and non-printing objects before, it’s really simple, but I haven’t done it with animations and swfs etc. but thought it might help.

    Well it’s an option anyway.

  26. June 1st, 2010 • 10:36 am • Link

    @Michael – That is a great solution

    @Eugene – I do agree that everything should be as simple as possible for the end user, but I think Michael’s point of a PDF portfolio would be a great solution too. That is not to say that your idea is not either:)

  27. Amy
    June 3rd, 2010 • 11:05 pm • Link

    @James

    I think them receiving 1 pdf would be better for the end user. I’ve set up PDFs with printing and non-printing objects before, it’s really simple, but I haven’t done it with animations and swfs etc. but thought it might help.

    Well it’s an option anyway.

  28. PublishMarket
    June 13th, 2010 • 6:49 am • Link

    I make interactive PDFs on a regular basis using InDesign – does anyone know if there is a browser capability (maybe a javascript or Flash solution) that would let me stream a website real-time into a PDF? If something like this could be done from within CS5 – that would be simple maaaahvelous!

  29. June 13th, 2010 • 5:14 pm • Link

    @ PublishMarket -

    CS5 will let you place a video from a URL. I have not tired it with streaming content, but it is an interesting idea.

    Here is the text from the help system explaining how to place a video from the URL.

    Place a video file from a URL

    Place a video file from a valid URL to play the streaming video in the exported PDF or SWF file. The video must be a valid Flash Video file (FLV or F4V) or H.264-encoded file (such as MP4).

    1. Select an empty frame or a video object containing a video you want to replace.
    2. Choose Video From URL from the Media panel menu.
    3. Specify the URL and click OK.

  30. K Intern
    August 9th, 2010 • 4:56 pm • Link

    thank you, thank you, thank you for that script!

    I have a 100+ pages presentation and the single page exporting was starting to break my spirit.

    FYI, The SWF file not scaling to page is supposedly fixed with Adobe InDesign CS5 7.0.2 update.

    Haven’t tested it yet but its listed as one of the fixes.

Subscribe to the Discussion

Get the ongoing discussion surrounding "Bringing Animation from InDesign CS5 into a PDF… with the help of a little script" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.