These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Hiding Annotations

itwmecheng
Registered: Oct 4 2007
Posts: 10
Answered

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?

My Product Information:
Acrobat 3D 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The Screen Annot (for multimedia) is controlable inthe way you'd like. Unfortunately, none of the other specialized annots, like 3D and Flash in Acrobat 9, can be controlled like this. The intention is that they stay put on the page.

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

itwmecheng
Registered: Oct 4 2007
Posts: 10
Hi, Thom. Thanks for your quick response.

I did try both ARTS PDF Aerialist Pro and Callas pdfToolbox 4 and although both tools let me create layers in my PDF, neither one allows me to select the 3D object or the Video objects to attach to the layers I created. Other objects can be selected, just not the ones I'm interested in.

Is the plugin you wrote available for download anywhere? I'm very interested in trying it.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I was hoping one of those tool would work. Odd, because structurally, it's easier to add a layer to an annotation than it is to add one to page content.

My plug-in isn't available yet. It's very crude at this point. Eventually it'll be posted at www.pdfscripting.com. There just hasn't been a lot of call for this type of thing so I haven't done anything with it. But if you send me the PDF I can attach the 3D annot to a layer for you.

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

efos
Registered: Jan 8 2009
Posts: 63
Fun fact: Rect only becomes accessible on RMAs if you dig deep into the black heart of Acrobat's tag system. I don't advise it D: (still not js accessible anyway).

No display property on a 3D/RM annot, no, but they do have a poster file. Set the poster image to something the user cannot see on the background. Then the activated property becomes your display property.

When active, you see your content, when inactive, it becomes a single pixel the same color as your background.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Using a transparent poster isn't as useful as you might think, because the RMA is still sensitive to the cursor. But if your RMA is going to display in a floating player, you can make the RichMediaAnnot real small and hide it behind a button. This works well for me.

But you never know, Adobe could still add a display property to the RMA, and even make the rect writable. This second one is more likely since the documentation says it's writable.

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