Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Ruling out non-adobe viewers
  FAQ FAQ  Forum Search   Register Register  Login Login

Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Ruling out non-adobe viewers

 Post Reply Post Reply Page  <12
Author
zhirik View Drop Down
New Member
New Member


Joined: 04 Jun 2013
Points: 32
Post Options Post Options   Quote zhirik Quote  Post ReplyReply Direct Link To This Post Posted: 17 Jun 2013 at 9:19pm
Hi gkaiseril,

Thank you for your response and for the suggestions!

Could you please explain why it is better to use the "!=", not equal, and not the "!==", strict not equal?

Thank you in advance!

Originally posted by gkaiseril gkaiseril wrote:

You also need to check for viewer "Exchange" and the viewer version.

if(viewer !== \"Exchange-Pro\") && (viewer !==\"Reader\")
 
 if(viewer !== \"Exchange-Pro\") && (viewer !==\"Reader\")
 
Should have both logical statements within parenthesis.
 
 if ( (viewer != \"Exchange-Pro\") && (viewer !=\"Reader\")  )
 
I would also use the "!=", not equal, and not the "!==", strict not equal, comparison.
 
Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4116
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 17 Jun 2013 at 6:24pm

You also need to check for viewer "Exchange" and the viewer version.

if(viewer !== \"Exchange-Pro\") && (viewer !==\"Reader\")
 
 if(viewer !== \"Exchange-Pro\") && (viewer !==\"Reader\")
 
Should have both logical statements within parenthesis.
 
 if ( (viewer != \"Exchange-Pro\") && (viewer !=\"Reader\")  )
 
I would also use the "!=", not equal, and not the "!==", strict not equal, comparison.
 
Back to Top
zhirik View Drop Down
New Member
New Member


Joined: 04 Jun 2013
Points: 32
Post Options Post Options   Quote zhirik Quote  Post ReplyReply Direct Link To This Post Posted: 17 Jun 2013 at 5:29pm
Hi guys,
 
I'd like to add a doc-level script (thru another script) that will check the viewer type, and if it neither Acrobat 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 the console notifies on syntax error on the line that comes after the script! But this line does not exist!
 
I also tried:
this.addScript("CheckViewer", "if(app.viewerType !== \"Exchange-Pro\") && (app.viewerType !==\"Reader\")\
     {app.alert(\"This Document Requires Adobe Reader or Acrobat Version 10 or Later.\");\
    this.closeDoc(true);}");
 
I guess, there is something wrong with  if(viewer !== \"Exchange-Pro\") && (viewer !==\"Reader\") part, but I can't figure out what the problem is.
 
I would appreciate your advice! Confused
Back to Top
 Post Reply Post Reply Page  <12
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.047 seconds.