PDF 无法在 Acrobat 中打开(PDF 和 Flash ActionScript)
我正在为我受雇的一家公司制作目录,但在浏览器而不是 Acrobat 或 Reader 中打开 PDF 文件时遇到问题。
PDF 文件全部存储在 CD 上,插入后会启动 Flash .exe 文件,该文件有一个按钮供最终用户单击并查看 PDF。现在,对于 Actionscript,打开 PDF 文件的代码与打开网页相同:
view_btn.addEventListener(MouseEvent.C… fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
{
navigateToURL(new URLRequest('IndexDividersv7.pdf'));
}
我进入 PDF 文件本身并取消选中“在浏览器中打开 PDF”选项,在我的计算机上它工作正常。当我单击 Flash 文件中的按钮时,它首先打开一个网页,但是内容下载后 Acrobat Pro 启动,我可以在 Acrobat 中查看 PDF 文件,没有问题。
然而,当我将 CD 加载到另一个人的计算机上,然后按下按钮打开主 PDF 文件时,它会直接在 Web 浏览器中打开并停留在那里。至少对于这里的所有计算机(我确信在其他计算机上)来说,这意味着每次用户单击使用书签打开另一个 PDF 文件时,都会弹出一个窗口,显示“允许打开网页吗?”您必须单击“是”或“否”。
这是一个大问题,因为 PDF 应该可以毫无问题地查看。我知道“允许”功能对于每台计算机来说都是主观的,所以我无法控制它,我唯一可以控制的(希望)是确保 PDF 在 Acrobat 而不是浏览器中打开。
我还能做些什么来使其严格在 Acrobat/Reader 中打开吗?或者 ActionScript 中是否有其他代码可以做到这一点?当我最初查看时,所有内容都指向 getURL 代码是打开 PDF 的唯一方法,但我想确定一下。
非常感谢任何帮助,提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,您需要做的是打开一个外部应用程序(acrobat),并传递您想要打开的文件的位置。
我不确定 AS3 是否可以做到这一点(我找不到任何参考),但我知道您可以使用第 3 方包装器,例如 SWF Studio。有一个示例供您下载。 (尽管这是付费产品)
http://www.northcode.com/ v3/exampleitem.php?link=25
您还应该考虑未安装 Acrobat 的情况。如果没记错的话,您可以通过 CDROM 提供 Acrobat 安装程序的可分发副本。
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.