Copy link to clipboard
Copied
Hi there,
I am in the process of putting together a presentation PDF that requires two gifs to be embedded on some pages.
I'm wondering if this is something that can be created with an interactive PDF?
I have embedded MP4s and MP3s in the past but can't seem to apply animated Gifs.
Is anyone here able to help me?
Thank you!
Patti
Copy link to clipboard
Copied
Take a look at this example file. If it does what you want, I'll share the technique.
Copy link to clipboard
Copied
Hi Joel,
thanks for sharing the example – I’m also looking for a way to integrate a small animation (animated GIF style) into a PDF. Can you please share the technique?
Best regards,
Till.
Copy link to clipboard
Copied
One additional question: could you also make the animation auto-run when opening the file (not having to click to start it)?
Copy link to clipboard
Copied
PDF files do not support animated gifs. They do support videos in mp4 format, or you can display the animation one frame at a time as the icon of a button field, like in @Joel_Geraci 's neat sample file from above. The latter is a nice solution if you have a limited amount of frames, and it can be set to run automatically when the file is opened. It does require more work setting up, though.
Copy link to clipboard
Copied
Thanks for the information!
Copy link to clipboard
Copied
Hi, I posted in another thread asking pretty much this question, found here: https://community.adobe.com/t5/acrobat-discussions/i-want-to-create-a-pdf-resume-with-gifs-looping-v...
Please I would love if you shared the technique of how you accomplished this. Thank YOU!
Copy link to clipboard
Copied
Hey Ryan, did you manage to find a solution for this? What did you do in the end ? Thanks :))
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thanks so much, have you found a way around it ? funny enough, I've been thinking about the same idea for a resume, as you have..then landed on your post here.. 🙂
Copy link to clipboard
Copied
I also wonder how it works.
I found that when the Button is clicked, the java code runs:
function nextFrame(){
var icon = this.getIcon("Muybridge_"+pad(interval.count,2));
this.getField("Muybridge").buttonSetIcon(icon);
interval.count++;
if (interval.count == 16) {
interval.count = 1;
interval.loopCount++;
if (interval.loopCount == interval.maxLoops) {
app.clearInterval(interval)
}
}
}
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
var interval = app.setInterval("nextFrame()", 75);
interval.count = 1;
interval.loopCount = 1
interval.maxLoops = 20;
Unfortunately, I don't know what this code is looking for.
That is, what names the individual frames of animation should have.
And what type of file it is looking for.
Maybe:
Muybridge_1.ico
Muybridge_2.ico
Muybridge_3.ico
And so the animation only works in Adobe.
Copy link to clipboard
Copied
I don't believe this file is working as intended anymore... Unless, of course, I'm opening or clicking on it wrong somehow.
Copy link to clipboard
Copied
Do not open it in your browser. Save it locally and then open it in Adobe Acrobat or Reader.
Copy link to clipboard
Copied
Hello Joel,
I would love to know how to do this (embed an animated gif or movie to a PDF) - especially if it could play in a loop on a page automatically without a button. Is that possible? Thanks
Copy link to clipboard
Copied
Please read this entire topic before asking questions that have already been answered.
Copy link to clipboard
Copied
Explanations:
In Joel's document there are 15 named icons:
icon[0]=Muybridge_01
icon[1]=Muybridge_02
icon[2]=Muybridge_03
icon[3]=Muybridge_04
icon[4]=Muybridge_05
icon[5]=Muybridge_06
icon[6]=Muybridge_07
icon[7]=Muybridge_08
icon[8]=Muybridge_09
icon[9]=Muybridge_10
icon[10]=Muybridge_11
icon[11]=Muybridge_12
icon[12]=Muybridge_13
icon[13]=Muybridge_14
icon[14]=Muybridge_15
See importIcon here: https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/doc.html#importicon
In Joel's script you will find "interval.count" which is the number of frames/icons to loop.
And "interval.maxLoops" which is the number of repeats.
You can change the name of the field and the name of named icons in these lines:
var icon = this.getIcon("Muybridge_"+pad(interval.count,2));
this.getField("Muybridge").buttonSetIcon(icon);