What is the path of your pdf? Is it local or through http:?
It is a local path.
The application decrypts pdf files that are encrypted through an application at my company.
It creates a new file (the PDF that is being opened) on the users machine and then opens it in an HTML loader in the application.
openPDF is called once the file has been created...
check the path structure. It sounds like you might be opening a pdf from a local server (\\mylocalserver) which macs will not read or you might be opening the pdf from the local machine with a absolute path (C:\Documents and Settings\user...). Try using a browseForOpen system or a more relative path.
Would this explain why I am getting 3201 when tracing HTML.pdfCapatibility, on Macs.
I apologize for the delayed response. been busy.
I further apologize for missing your sentence about the 3201 error in the original post.
Were you able to solve your problems?
To answer your last question: No, faulty path definition would not display the 3201 error. Your trace should read "0" if Reader is installed. The white box will always show up when you initiate a pdf request through HTML (unless you change the background color, of course).
The only way I have been able to reproduce your error on the Mac is by uninstalling Reader altogether, or by installing incorrectly. By this I mean forcing unseen errors on install, which probably wouldn't have happened when you installed Reader. But, you may want to check that Reader is properly installing to the \Applications directories on all your Macs, which doesn't seem like it would make any difference - but you never know sometimes.
I recommend building a very simple pdf viewer with traces to test, so as not to interfere with your main application.
If you are still having problems, please let me know and I will try to troubleshoot as best as possible.
Thanks for the reply. I havent solved the problem yet. I will try your suggestions on Sunday and let you know the results.
I did verify that Acrobat reader was installed and even unintalled/reinstalled it... I still got 3201.
Just to clarify- From what you wrote, it seems that you have been able to detect Reader, and launch PDFs on a mac, is that correct?
Thanks for the help!
Yes, I have been able to open PDFs in AIR on Mac.
I discovered that Reader was not being installed correctly on our test machines and corrected that problem, which solved this issue. Thank you for your help.
My next question is: What is the smoothest way to allow users who do not have the correct version of Reader to install it? Can the download from Adobe be launched through the browser inside the AIR application? I think I had some trouble while trying to do this.
1 person found this helpful
No, I do not think there is a way you will not be able to initialize the download within your HTMLLoader directly (unless someone else has figured out a way).
I suppose you could check which OS version they are on (Windows vs OSX) based on that you can copy the zip directly from Adobe's site and paste it to the desktop while a progress shows. Its a bunch of code writing on your part, and the user would still have to do a little work in installing Reader. Its kind of a pain in the *** and you'd be creating your own download dialog.
It would probably be easier to coerce the user to download and install Reader. There are any number of ways to do this. How you do it is up to you.
What I would do is if HTMLPDFCapability is anything but STATUS_OK (your else statement) then bring up a pop up explaining the issue with a button to navigate to the Reader Download site in their default browser. Sucky to make them use the default browser, i know, but its easier on you and - from my experience - your co-workers won't really notice or care that it opens the default browser.
Launching the download site in the default browser would be an acceptable solution.
Is it possible to launch an external application (the default browser) via an AIR application?
Not at the present time, unfortunately.
Here's how I launch the default browser from AIR:
So how did you fix the bad installs of Adobe Reader? What was wrong with them? I'm dealing with this same issue on my Mac now....I keep getting the dreaded 3201. I'm actually redirecting the user to download the PDF now as a workaround, when HTMLPDFCapability fails:
navigateToURL(new URLRequest("file://" + pdfFile.nativePath),"_blank");
This causes Firefox to ask me if I want to open or save the file. Kinda kludgey, but better than no file.
Disclaimer: I'm using SDK 4.0 Beta.
I think that the problem was that Acrobat needed to be run to accept the licensing agreement before AIR would recognize it. I was skipping this step when installing.
Try launching acrobat from the applications directory and see if this works for you.
As far as launching the default browser...While that does work (and is also the solution I decided to use) I have read that it is somewhat unstable and you cannot be sure that all machines will handle this command, although all machines that I have tested on do launch the default browser as I want.
Let me know if this gets you passed the 3201.
Good call! That's exactly what it was. I accepted the license and all is good.