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

How to determine which browser should open a link annotation?

djonatah
Registered: Jul 6 2011
Posts: 3
Answered

Hi,
 
I've been creating PDF files which are intended to be embeded in HTML pages. The pdfs I create are going to have link annotations to other web pages, so far so good. This is my problem:
 
1)I create a pdf file, and I also add JavaScript annotations using app.LaunchURL() function.
2)I Insert pdfs to HTML pages using tags;
3)I open those HTML pages with embeded PDF files, and then I in the link in the pdf file:
. a)If I'm using firefox browser (which one is my default OS browser), a new TAB in firefox opens the targeted link.
. b) If I'm using IExplore, a new Internet explorer WINDOW opens the targeted link
. c) I I'm using Opera browser, a new firefox window opens the targeted link (and NOT an opera instance)
  
I've read PDF specification, but I found nothing about that. What determines which browser should be used to open when app.LaunchURL function is called?
 
I'd really appreciate your help,
Thanks

My Product Information:
Reader 10.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
There is no specification for this. In fact, most of the process happens outside of Acrobat. Acrobat essentially hands the URL off to the OS and then the OS decides what to do with it.


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

djonatah
Registered: Jul 6 2011
Posts: 3
Ok, I think I understood it. But what if I use a Launch action instead of a JavaScript one? So I could make sure which browser is launched, right?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I guess my point was that from inside of Acrobat there is no control over which browser is used. All interactions between a PDF document (as well as the scripts in the PDF) and the outside world (email, file system, internet, printers, etc.) are handled in a very generic way to make those interactions as platform independent as possible.

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

try67
Expert
Registered: Oct 30 2008
Posts: 2398
It's no longer possible to launch an application from a PDF, due to security reasons.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

djonatah
Registered: Jul 6 2011
Posts: 3
try67 wrote:
It's no longer possible to launch an application from a PDF, due to security reasons.
Are you sure? Because I read it IS possible from pdf reference (found at http://www.adobe.com/devnet/pdf/pdf_reference.php), section 8.5.3.

Am I missing something?
Thanks
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You are correct that the "Launch" action as described in the PDF spec allows for the inclusion of a platform specific application path/command line. However, there are a number of issues (as pointed out by try67) that may hamper your ability to use this feature.

1) There are no tools for setting up such an Action Dictionary. You would need to either write a plug-in for this purpose, or use a COS editor tool such as "PDF CanOpener" (http://www.windjack.com/product/pdfcanopener/) to manually create and setup the action.

2) Acrobat does not implement the complete PDF specification. There are many, many features outlined in the spec that never made it into the real world, mostly because it turns out they just weren't practical. Just because it's there doesn't mean they have to implement it.

3) In the most recent versions of Acrobat, Adobe has become particularly security conscious. As an example, take a look at the "doc.exportDataObject()" function. This functionality is very similar to the launch action, and in Acrobat 6.0 is was hobbled for security reasons.

If you really want to check it out I'd suggest downloading the trial version of PDF CanOpener and use it to build a Launch Action dictionary. Then you can test it to see if it really does work the way you want it too.

If you do this please let us know how it works out.


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