Force button within a PDF to open new window when clicked

Do you know if it’s possible to create a button in a PDF, then somehow force the button to open content in a new window? I tried adding in some javascript to force a new window to open:

app.launchURL("myURLhere", true);

but it seems like a person’s personal Adobe Acrobat settings can override it no matter what. The PDF is going to be hosted on a server and I noticed when I clicked the link it automatically opened the PDF in a browser window and when I clicked the button within the PDF it just brought me to the new content in the same browser window. So I had to click the back button to return to the PDF. However once I changed my Adobe Acrobat settings I was able to download the PDf and it all worked fine.

So... just wondering if there is anyway to override this, and force a new window to open even when the PDF is viewed in a browser? Or is it just a matter of people’s personal computer settings?


Krista Pavao


Voted Best Answer

The type of behavior your talking about is not well defined in the public documentation and tends to vary between versions. For example, the app.lauchURL function is specific to web content, were as you have described a scenerio where you are opening a PDF. Opening a PDF goes with the "Open Cross Links in new Window setting". There is a bit of confusion in how opening a new file works given the different content types and settings for that type.

But may there is a solution. Try this setting before running the LaunchUR function

app.openInPlace = false;
app.launchURL("MyURL",true);


Thom Parker
The source for PDF Scripting Info pdfscripting.com
All About PDF Stamps in Acrobat and Paperless Workflows - THE BOOK !!

The Acrobat JavaScript Reference, Use it Early and Often

The most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Having trouble, Why Doesn't my Script Work


By Thom Parker   


Please specify a reason: