[pdf] Is it possible to embed animated GIFs in PDFs?

Is it possible to embed animated GIFs in PDFs? And how might I go about such a thing? are there any dangers I should be aware of?

For some more details on why I think it's a good thing and how it helps feel free to see this post. I didn't think it was appropriately well-formed enough for SE.

As an example - I'd like to put this into a description of quicksort:

quicksort animation from wikipedia
(This animation is from wikimedia.)

This question is related to pdf animated-gif

The answer is


Having the ability to add small animations to a PDF (portable document format, independent of application software, hardware, and operating systems) would make it the perfect solution for making extremely useful user guides. Some text, some images, and some animations/videos, all in one file that can be read by anybody on any computer.

As of acrobat pro version x, a gif can be added under Tools > Insert from File. But the gif wont play, it only shows the first image.


Maybe use LaTeX and try something like this

\documentclass[a4paper]{article}
\usepackage[3D]{movie15}
\usepackage{hyperref}
\begin{document}
\includemovie[
    poster,
    toolbar, 
    3Daac=60.000000, 3Droll=0.000000, 3Dc2c=0.000000 2.483000 0.000000,     3Droo=2.483000, 3Dcoo=0.000000 0.000000 0.000000,
    3Dlights=CAD,
]{\linewidth}{\linewidth}{Bob.u3d}
\end{document}

where Bob3d.u3d is a sample virtual reality file I had. This works (or did) for movies, and I expect it might work for gifs too.


You can use Tikz/pgfplots for creating animations in beamer. http://www.texample.net/tikz/examples/tag/animations/


I just had to figure this out for a client presentation and found a work around to having the GIF play a few times by making a fake loop.

  • Open the Gif in Photoshop
  • View the timeline
  • Select all the instances and duplicate them (I did it 10 times)
  • Export as a MP4
  • Open up your PDF and go to TOOLS> RICH MEDIA>ADD VIDEO> then place the video of your gif where you would want it
  • A window comes up, be sure to click on SHOW ADVANCED OPTIONS
  • Choose your file and right underneath select ENABLE WHEN CONTENT IS VISIBLE

Hope this helps.


I do it for beamer presentations,

provide tmp-0.png through tmp-34.png

\usepackage{animate}

\begin{frame}{Torque Generating Mechanism}
  \animategraphics[loop,controls,width=\linewidth]{12}{output/tmp-}{0}{34}
\end{frame}

It's not really possible. You could, but if you're going to it would be useless without appropriate plugins. You'd be better using some other form. PDF's are used to have a consolidated output to printers and the screen, so animations won't work without other resources, and then it's not really a PDF.


Another possibility is LaTeX + animate package. You will need to provide the individual frames making the animation. The resulting pdf does NOT require any plugin, the animation is shown in Adobe reader