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

Creating popup windows?? I can't find the answer anywhere!

Chrissy1013
Registered: Oct 14 2008
Posts: 10

Hello,

I'm trying to create a pop up window. So, if someone were to click on a tect link on a pdf page a smaller window will pop up within that page which can then be closed with a close button. I got the idea from the "Callaway Golf Products eCatalogue" interactive PDF off this website: http://www.pdfpictures.com/ebrochures.php

I've been looking all night and I can't find any hints on how this was done... i've looked up action options, javascipt options and nothing so far.

Any help would be great! thanks!

My Product Information:
Acrobat Pro 8.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You need to get the Acrobat JavaScript reference. There are several things that could be considered popups in that example. The first is a popup menu (e.g., when you click Index) that is implemented using the app.popUpMenu or app.popUpMenuEx JavaScript method.

Another is a button field that appears when "Specifications" is clicked. When the button that is subsequently displayed is then clicked, the button gets hidden. Button fields can display images (and anything else that a PDF page can) as their icons, and can be shown/hidden using JavaScript. This is probably what you're asking about. If you'd like to see some sample code that controls this behavior, post again.

George
Chrissy1013
Registered: Oct 14 2008
Posts: 10
Yes, i'm def. wondering about how to do the popup window when you click on "specifications" and that nice window shows up in the corner with a close button.

How would i go about getting that affect?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
To show a button field, the JavaScript you'd use (in another button's Mouse Up event, for example) could be something like:

// Show a previously hidden buttongetField("image_button").display = display.visible;

where "image_button" is the name of the button.

To make the image button hidden again when it is clicked, you could use the following code in the image button's Mouse Up event:

// Hide this buttonevent.target.display = display.hidden;

George
Chrissy1013
Registered: Oct 14 2008
Posts: 10
Wow, it works!

Thank you so much for sharing that with me!! I can go to bed now! lol :) Seriously though, I've been sitting at my desk all night trying to figure this one out and it's so simple now that i see it.

Cheers!
jastrock
Registered: Oct 21 2008
Posts: 1
I am very interested in this use too. I am still relatively new to modifying Acrobat documents, though, and could use a bit more explaining. Specifically, how does one add a button to the PDF to add the above javascript to it?

Also, would this first button be able to be a blank rectangle over an already existing image in the PDF file? And would I need Acrobay 8 Professional for this; I only have Standard now but can probably upgrade?

Thanks for any help, this would be quite useful,

Jesse
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Although you can create fields with Acrobat Standard 9, I would suggest getting at least Pro 9 if you intend to get into doing more forms work. Acrobat 8 Standard does not have the required tools to add form fields.

To create a button, you use the Button tool. To set up the various button properties, you open the Button Properties window and make your selections. You can place code in a variety of events, thought the most common event for a button is the Mouse Up event, which occurs when the user clicks and releases a button. Other events include Mouse Down (rarely used), On Focus, On Blur, Mouse Enter, and Mouse Exit.

Yes, a button can be placed over an existing image on the page and have no visible appearance (i.e., transparent). The disadvantage of doing this is you often don't want buttons to print, and if you use the underlying page contents to indicate the location of a button, it will print. Buttons can be set up to be visible in Acrobat, but not print.

For someone just starting out, there is a lot of information here about creating forms and programming with JavaScript. See the "JavaScript Corner" for example. And there's now www.pdfscripting.com for much more information.

George
scottsheck
Registered: May 3 2007
Posts: 138
George,

I noticed you mentioned that version 9 has more tools to work with than 8. I do a lot of forms work and only loaded version 9 a few days ago, but no big differences stand out. Can you let me know a couple tools that 9 has that version 8 does not because I would like to upgrade, but currently don't see any new features to make me want to do so. thanks a lot for your info above also, using the button is really a nice tip.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
The change I was referring to is the ability to create forms with Acrobat 9 Standard, which was not possible with previous versions of Standard.

Form authoring has changed a bit with Acrobat Pro 9, as there is now a separate forms editing mode. There are not a lot of new tools really, but by far the biggest change with respect to forms and Acrobat 9 is the new Rich Media Annotation (RMA) type. This opens up a whole new universe of features that can be added to Acrobat forms, but there is a cost. It involves co-development in Adobe's Flex/Flash environments, but from what little I've seen it is well worth it. You can develop components in Flex/Flash, place them in a PDF as an RMA, and communicate using the Acrobat JavaScript - ActionScript bridge. Very cool stuff.

Thom Parker has teased us with a recent article here, and Dr. Story has as well with some information on his AcroTex web site: http://www.math.uakron.edu/~dpstory/pdfblog.php

He's created a very interesting graphing application and promises more in the future. I bet we'll see more from Thom as well.

George