Is it possible to embed animated GIFs in PDFs?

PdfAnimated Gif

Pdf Problem Overview


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.)

Pdf Solutions


Solution 1 - Pdf

I haven't tested it but apparently you can add quicktime animations to a pdf (no idea why). So the solution would be to export the animated gif to quicktime and add it to the pdf.

Here the solution that apparently works:

  1. Open the GIF in Quicktime and save as MOV (Apparently it works with other formats too, you'll have to try it out).
  2. Insert the MOV into the PDF (with Adobe InDesign (make sure to set Object> Interactive> film options > Embed in PDF) - It should work with Adobe Acrobat Pro DC too: see link
  3. Save the PDF.

See this link (German)

Solution 2 - Pdf

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}

Solution 3 - Pdf

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.

Solution 4 - Pdf

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

Solution 5 - 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

Solution 6 - Pdf

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.

Solution 7 - Pdf

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.

Solution 8 - Pdf

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoeView Question on Stackoverflow
Solution 1 - PdfestaniView Answer on Stackoverflow
Solution 2 - PdfahmedyarView Answer on Stackoverflow
Solution 3 - PdfCSturgessView Answer on Stackoverflow
Solution 4 - PdfMoksherView Answer on Stackoverflow
Solution 5 - PdfMassiView Answer on Stackoverflow
Solution 6 - PdfJohn StarrettView Answer on Stackoverflow
Solution 7 - PdfCelineView Answer on Stackoverflow
Solution 8 - PdfHenryView Answer on Stackoverflow