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

How to change the url of a parent window from a pdf in a pop up.

cottonla
Registered: May 26 2009
Posts: 6

Hi,

I have a Flex application which opens a pdf in a popup window using the actionscript:

navigateToURL(myRequest,"_blank");

In the pdf that opens in the pop up I want to create a link which changes the url of the parent window (containing the Flex application).

The idea is that the pdf in the popup will contain a diagram of a piece of equipment with links for the various parts of the equipment. Clicking on a link will cause the flash application to display the product details for that part (using deep linking).

I've tried using a javascript action of the form:

window.opener.location='somepage.htm'

but with no success. Any help would be greatly appreciated.

Thanks

My Product Information:
Acrobat Pro 9.1.1, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Acrobat uses Acrobat JavaScript not HTML JavaScript. There are many differences. See the Acrobat JavaScript reference, the link is in the anchored FAQ's for this forum.

George Kaiser

cottonla
Registered: May 26 2009
Posts: 6
I've been going through the Acrobat Javascript api docs and can't find anything that seems to do what I require. Can anyone point me in the right direction?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Have you read the description of the "launchURL()" method under the "app" objcect?

Have you found a "window" object or "location" property?

George Kaiser

cottonla
Registered: May 26 2009
Posts: 6
app.launchURL() appears to only allow opening of a url in the same or a new browser window.

What I'm after is to be able to modify the url of the parent browser window which created the window with the pdf in it.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
For security reasons there is very little control a PDF JavaScript can exert over the browser environment. But there are some tricks you can play. They may not always work because of external factors like the user's version of Acrobat/Reader and thier browser security settings. But try this script from a button in a PDF

app.launchURL("javascript:window.navigate('http://www.windjack.com')");

Within limitations you can pass Browser JavaScript commands in an URL from Acrobat JavaScript.

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]

Then most important JavaScript Development tool in Acrobat
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script