问题
I'm currently creating a PDF portfolio which displays data in a dataGrid. There are a number of attachments and when I doubleclick the specific attachment I would like it to display in a new acrobat/reader window.
Could anyone instruct me?
Chris
回答1:
As far as I know, this cannot be done in a web-based Flash file. It must be done in an AIR Application.
See this Adobe article. Relevant information:
In AIR 2, you can open a file using the application registered by the operating system to open it. For example, an AIR application can open a DOC file with the application registered to open it. Use the openWithDefaultApplication() method of a File object to open the file.
You can use FileReference
to allow the user to save the PDF to their system, but I do not believe there is a way to force it to open within an application. In fact, I don't think you can force an application to open via a download (without user permission, anyway) via standard JS/PHP methods either (I'm not a master of either of these, so I could be wrong there)
回答2:
Originally I was having serious issues accessing the host using a flex4 project.
This led me to switching to flex3 because I had found many examples of code that works just fine.
These examples can be found here
来源:https://stackoverflow.com/questions/13015162/how-can-i-open-an-attachment-from-a-pdf-portfolio