简体   繁体   English

如何通过Java脚本代码控制Adobe Acrobat中pdf文件的加载事件

[英]How to control the load event of a pdf file in adobe acrobat by java script code

I have a pdf file. 我有一个pdf文件。 I want to display that pdf file only in cases where Adobe Acrobat is installed on the user's machine,otherwise I want to show an error page. 我只想在用户计算机上安装了Adobe Acrobat的情况下显示该pdf文件,否则我想显示一个错误页面。 How I can accomplish loading of the pdf file through JavaScript only when Adobe Acrobat is present? 仅当存在Adobe Acrobat时,如何才能通过JavaScript完成pdf文件的加载?

As the dumb PDF viewer may not understand JavaScript, you will have to do it "the other way round". 由于笨拙的PDF查看器可能无法理解JavaScript,因此您将不得不“反过来”进行操作。 You will provide the document with the error page, and have code to "activate" it within Acrobat/Reader. 您将为文档提供错误页面,并具有在Acrobat / Reader中“激活”它的代码。

The property to look for when doing such a test would be app.viewerType , which could be "Reader", "Exchange", or "Exchange Pro". 做此类测试时要查找的属性是app.viewerType ,可以是“ Reader”,“ Exchange”或“ Exchange Pro”。 Another viewerType designates another application. 另一个viewerType指定另一个应用程序。 You might also evaluate app.platform. 您可能还会评估app.platform。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM