Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Question to Adobe: Ruling out non-Adobe viewers via Acrobat Javascript

$
0
0

Hi,

 

***I would like to address this question to Adobe Acrobat developers:****

 

I'd like to add a doc-level javascript (thru another script) that will check the viewer type, and if it neither Acrobat (6 and higher) nor Reader, the document will close.

 

So I wrote:

 

...

this.addScript("CheckViewer", "var viewer = app.viewerType;\
     if ((viewer !== \"Exchange-Pro\") && (viewer !==\"Reader\"))\
     {app.alert(\"This Document Requires Adobe Reader or Acrobat Version 10 or Later.\");\
    this.closeDoc(true);}");

 

The script is correctly placed in the document, BUT if I open the document in Foxit Reader, for example, nothing happens just because Foxit disguises itself as "Reader". Is there a way to overcome this problem?

 

I think, the best way would be to change the Acrobat Javascript API so that  app.viewerType values will be: Adobe_Exchange-Pro, Adobe_Exchange, and Adobe_Reader.

 

I would appreciate your advice!


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>