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

Web Page in new browser

JVar
Registered: Dec 3 2008
Posts: 14
Answered

Hi All,
I'm new at acrobat and javascript. I am trying to launch a webpage from a pdf button. I want the browser to be without toolbars and at 800*600. Is there anyway to do this using javascript? I have learnt that window.open() does not work from acrobat.
Actually I'm not particular about javascript...any solution is ok as long as I can open the page in an 800*600 window, without toolbar/menus. I thought this would be simple...maybe I am missing something.

Thanks for any help.
-Jake

My Product Information:
Acrobat Pro 6.0.6, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The easiest way to do this is to create a button or link and add an "Open Web Link" action to it. How the web page is actually opened is a matter of how you write the URL. All Acrobat does is pass the URL off to the browser.

For example, Acrobat runs Acrobat JavaScript, not browser JavaScript. But the URL:
javascript:window.open("http://www.pdfscripting.com","Blank", "height=600,width=800");

will cause the browser to run JavaScript. Unfortunately Acrobat is very touchy about what's passed in an URL. This code may or may not work, depending on the user's specific setup. A better methodology is to navigate directly to a web page.

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

JVar
Registered: Dec 3 2008
Posts: 14
Hi Thomp,
Thanks for the reply. I tried what you suggested but it does not work on my setup either. Could I disable something in the acrobat setup that in turn WILL allow the line of code to work?
regards
-Jake.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I don't know exaclty what setting to change. The code URL works from Both my Browser and Acrobat. However, if I have IE7 already open with a current page showing on the tab, it fails with an error "IE cannot download, Unspecified Error". The problem seems to be on the IE side so I suspect it's an browser setting. This is probably different for every version of the browser and Acrobat.

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

JVar
Registered: Dec 3 2008
Posts: 14
thomp wrote:
The problem seems to be on the IE side so I suspect it's an browser setting. This is probably different for every version of the browser and Acrobat.
Thats not good for me. Ok thanks for the clarifications!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Don't loose heart. This question has actually been asked a few times. Do some searches on this and other PDF forums and I think you'll find a lot of suggestions for doing this in differnt ways. Unfortunately they all suffer siimilar problems.

I didn't bring this up earlier because you have Acrobat 6. In Acrobat 7 the "app.launchURL()" function was added to the Acrobat JavaScript model. This function has an input argument for forcing the web page to open in a new window. If your users are on a later version it will work for them. Look it up in the Acrobat JavaScript Reference

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

blindcorpse
Registered: Dec 12 2008
Posts: 6
I have a slightly different problem, and I wonder if you have any suggestions. (Hmm, maybe I should post this as a new topic, but I'll try it here first.)

I have a PDF file that is a translation of a Chinese text that is online. In the margins of the English translation I am creating links to the corresponding locations in the original Chinese file. No problem with this, either using Acrobat's "open URL" or the javascript app.launchURL () method.

The problem is that each link, when clicked, opens in a new tabbed window in the browser. (At least, this is the behavior I get with Mac and Firefox.)

Is there any way to get the link to open in the same window? That is, once the user has opened up a browser window to the original Chinese file, can any subsequent links replace the Chinese text in the same window?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
have you tried this?

app.launchURL("...",false);

Acrobat simply dumps the URL to the system. How it's interpreted and used is out of Acrobat's hands. So of course there will be wild variations between different setups.

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

blindcorpse
Registered: Dec 12 2008
Posts: 6
Yes, I tried using app.launchURL("...",false); -- and it doesn't change the behavior, at least using my setup (MacBook and Firefox 3). Each click of a new link in the PDF file opens up a new tab in Firefox.

I'm beginning to think that this is just something our end-users will have to deal with. That is, if they want to see the original text in a browser, they'll have to trim away any excess tabbed windows that open up. Hmm, unless I figure out some way to imbed the "back" and "forward" options in the web page I send them to.

In other words, in theory, couldn't I send the users to a URL that included a frame providing "back" and "forward" scrolling capabilities, with the target text included in an enclosed frame? I'm not sure I'm making myself clear... but I would have to design a web page that would serve as "mother ship" for the target text data.