0
votes

I'm working on a Catalog for a company I'm employed with, but I'm having issues with the PDF files opening in a browser rather than Acrobat or Reader.

The PDF files are all going to be on a CD, that once inserted launches a Flash .exe file which has a button for the end user to click and view the PDF. Now for Actionscript the code to open a PDF file is the same as opening a web page:

 view_btn.addEventListener(MouseEvent.C… fl_MouseClickHandler);

 function fl_MouseClickHandler(event:MouseEvent):void
 {
 navigateToURL(new URLRequest('IndexDividersv7.pdf'));
 }

I went into the PDF file itself and un-checked the option 'Open PDF in Browser' and on my computer it works fine. When I click the button in the flash file, it opens a web page at first, but the moment the content downloads Acrobat Pro launches and I can view the PDF files in Acrobat no problem.

However, when I take the CD and load it onto another person's computer, and press the button to open the main PDF file, it opens directly in a web browser and stays there. At least for all the comptuers here (and I'm sure on other computers), that means that every time the user clicks to open another PDF file using the bookmarks, a pop-up says 'allow web page to open?' and you have to click yes or no.

This is a huge problem, because the PDF's should be viewable without these hiccups. I know that the 'allow' feature is something that is subjective to each individual computer, so I cant control that, the only thing I can control (hopefully) is making sure the PDF opens in Acrobat and not a browser.

Is there anything else I can do to make it open strictly in Acrobat/Reader? Or is there another code in ActionScript that will do that? When I had looked initially all things pointed to the getURL code as the only way to open PDF's, but I wanted to make sure.

Any help is greatly appreciated, thanks in advance.

1

1 Answers

0
votes

Basically what you need to do is open an external application (acrobat), passing the location of the file you wish to open along with it.

I'm not sure if AS3 can do that (I can't find any references) but I know you can use a 3rd party wrapper such as SWF Studio. There's an example for you to download. (although this is a paid for product)

http://www.northcode.com/v3/exampleitem.php?link=25

You should also factor in for instances where Acrobat is not installed. If memory serves you can ship a distributable copy of the Acrobat installer on the CDROM.