Skip to main content
Participant
February 17, 2018
Answered

Page Template Issue

  • February 17, 2018
  • 1 reply
  • 1199 views

So I am working on spawing a page template when a button in my PDF is clicked, then destroying it when the page is left. The page template has a video embedded that gets lost each time I spawn the template. All of the other items on the page show up, (text and button) but the video gets stripped. What am I doing wrong here?

Any help would be greatly appreciated!

because someone is bound to ask. Windows 10, Acrobat Pro DC

This topic has been closed for replies.
Correct answer Joel Geraci

So its stripping the video completely. It would be preferable to unhide the template instead of spawn one. Is that possible?

I am currently using the following code to spawn the template:

var a = this.getTemplate("Resources");

a.spawn ();

A little more detailed info: I build this .PDF in InDesign and need to "hide" and "show" these pages when a user clicks on certain buttons.


Ok - First... Never, never, NEVER.... build interactive PDF in InDesign if you are planning on automating it using scripts. Put the pages together in InDesign and then add the interactive components in Acrobat. I'll spare you the details; just trust me on this one.

You seem to know how to create a template so I won't go into that. Hiding and showing it uses the hidden property. So to show a hidden template use...

this.getTemplate("Resources").hidden = false;

To hide it use true instead of false.

If that doesn't fix the issue, file a bug report. The entire page content should still be there between hides and shows. I imagine that a rich media annotation maybe shouldn't survive a page spawn because a page can be spawned multiple times; while unexpected, that might actually be the correct and desired behavior.

1 reply

Joel Geraci
Community Expert
Community Expert
February 17, 2018

Is the video just gone and the annotation still there or is the whole thing gone?

J-

Participant
February 17, 2018

I believe the whole video is gone. How do I check to see if its leaving an annotation from the video on the page?

Joel Geraci
Community Expert
Community Expert
February 17, 2018

Use the Multimedia tool again and see if the rectangle is still there. Also did you spawn the page or unhide the template?