I'm using Acrobat 8.1.2 3D to develop a PDF with mixed content: a 3D annotation and a few Flash video annotations. I'd like to use buttons to control the visibility of each annotation so that only one is visible at a time.
My first thought was to use layers, attach each annotation to a separate layer, and use actions with each button to control the visibility. However, I'm unable to find a way inside Acrobat or even with third party tools to attach a 3D object or a video object to a layer.
My next thought was to forget about layers and use javascript to hide the individual annotations. I believe this can be done with the video - "ScreenAnnot" has a "display" property - but I can't see a way to hide a 3D object this way -"3DAnnot" does not have a "display" property.
So my third idea was to shrink the size of the 3D annotation to zero using the "rect" property of "3DAnnot", but I cannot get this to work, either.
My code looks like this:
var my3D = this.getAnnots3D(0)[0]; console.println("Before: " + my3D.rect); var aRect = [0,0,0,0]; my3D.rect = aRect; console.println("After: " + my3D.rect);
Debugger results:
Before: 167.46499633789062,482.5950012207031,752.0709838867188,265.6029968261719 After: 167.46499633789062,482.5950012207031,752.0709838867188,265.6029968261719
Does anybody have any suggestions?
The layers idea is a very good one, and it works for an in-active 3D Annot. When a media annot is active the player takes over. But as you've found out, there aren't any Acrobat tools for attaching an annot to a layer. As a kind of cheat you might consider putting a transparent poster on the 3D annot. At least that will make it invisible.
I actually wrote a plug-in for attaching an annotation to a layer years ago, when layers were new. And it works like a charm. You might be able to use other 3rd Party layer tools for this. There's one made by Arts PDF and one made by Callas. Take a look them. If neither of these will work for you then drop me a note and maybe we can work something out.
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script