determining Adobe Acrobat PDF plugin version

B

Beline

how to programmatically determine Adobe Acrobat PDF plug-in version
installed in Firefox and Opera?
Is it possible with Javascript?

Thanks.
 
J

Joe Nine

Beline said:
how to programmatically determine Adobe Acrobat PDF plug-in version
installed in Firefox and Opera?
Is it possible with Javascript?

Thanks.

Surely the FAQ at adobe.com would explain that.
 
D

David Mark

Surely the FAQ at adobe.com would explain that.

I wouldn't count on it (at least not to explain it well). For
example, their Flash version detection is all tangled up in UA-based
browser sniffing.
 
G

Garrett Smith

Adobe has published documents related to Flash detection that are
harmful and misleading. For example:

http://www.adobe.com/devnet/flashplayer/articles/future_detection_02.html

Which will fail anytime the userAgent string contains "msie" but doesn't
support VBScript. It is browser detection at its worst and a good
example of code that is not "forwards compatible".

Like flash, Acrobat is a plugin, however you should keep in mind that
Adobe Acrobat is not the only PDF viewer. Foxit, for example, Safari has
its own preview for PDF files that does not rely on any Adobe plugin.

The web page might provide a link to the PDF and leave it up to the user
to download that or view it as he wishes (right click and save, etc). It
may be worth considering providing a link to a reader/plugin.
 
T

Thomas 'PointedEars' Lahn

Garrett said:
[...]

Like flash, Acrobat is a plugin, however you should keep in mind that
Adobe Acrobat is not the only PDF viewer. Foxit, for example, Safari has
its own preview for PDF files that does not rely on any Adobe plugin.

The web page might provide a link to the PDF and leave it up to the user
to download that or view it as he wishes (right click and save, etc). It
may be worth considering providing a link to a reader/plugin.

However, plugin detection appears to be rather easy to do in the targeted
environments using navigator.plugins.


PointedEars
 
D

David Mark

Garrett said:
Beline said:
:
Beline wrote:
how to programmatically determine Adobe Acrobat PDF plug-in version
installed in Firefox and Opera?
Is it possible with Javascript? [...]

Like flash, Acrobat is a plugin, however you should keep in mind that
Adobe Acrobat is not the only PDF viewer. Foxit, for example, Safari has
its own preview for PDF files that does not rely on any Adobe plugin.
The web page might provide a link to the PDF and leave it up to the user
to download that or view it as he wishes (right click and save, etc). It
may be worth considering providing a link to a reader/plugin.

However, plugin detection appears to be rather easy to do in the targeted
environments using navigator.plugins.

Yes, but what would you do differently if the plug-in was detected (or
not).
 
D

David Mark

I wouldn't count on it (at least not to explain it well).  For
example, their Flash version detection is all tangled up in UA-based
browser sniffing.

That's not a solution. It's a pile of dated delusions.

function(){var $=this,nav=navigator,userAgent=
$.isString(nav.userAgent)?nav.userAgent:"",vendor=
$.isString(nav.vendor)?nav.vendor:"",platform=$.isString(nav.platform)?
nav.platform:"";$.OS=(/win/i).test(platform)?1:((/mac/
i).test(platform)?2:((/linux/i).test(platform)?3:4));$.convertFuncs($);
$.isIE=/*@cc_on!@*/false;$.IEver=$.isIE&&((/MSIE\s*(\d\.?\d*)/
i).exec(userAgent))?parseFloat(RegExp.
$1,10):-1;$.ActiveXEnabled=false;if($.isIE){ ...

"Note to users: I need some information from Macintosh users to
improve Adobe Reader detection. If you have a Macintosh with Adobe
Reader 8 installed, then with your Safari (and/or Firefox) browser, go
to this page. Select all the text on that page, copy, and paste into a
text file. Then email that text file to Eric Gerds . That would be a
big help to me. Please also mention the exact version of Adobe Reader
you have installed when you email me. BTW, I already have info on Mac/
Adobe Reader 7 & 9."

Another "test swarm". :)

From glancing at the rest of the article, the problem they are
attempting to solve (one observed browser at a time) may well be
impossible. In such a case, the only course of action is avoidance
(not continuing down the endless road they are on).

And if you think about it, you really can't know what sort of Acrobat
reader the end-user might have installed. Link to the PDF with a
disclaimer that links to Adobe's download page. Problem solved
(forever).
 
T

Thomas 'PointedEars' Lahn

David said:
Thomas said:
Garrett said:
Beline wrote:
:
Beline wrote:
how to programmatically determine Adobe Acrobat PDF plug-in version
installed in Firefox and Opera?
Is it possible with Javascript?
[...]

Like flash, Acrobat is a plugin, however you should keep in mind that
Adobe Acrobat is not the only PDF viewer. Foxit, for example, Safari
has its own preview for PDF files that does not rely on any Adobe
plugin.

The web page might provide a link to the PDF and leave it up to the
user to download that or view it as he wishes (right click and save,
etc). It may be worth considering providing a link to a reader/plugin.
However, plugin detection appears to be rather easy to do in the targeted
environments using navigator.plugins.

Yes, but what would you do differently if the plug-in was detected (or
not).

There are several possibilities.


PointedEars
 
D

David Mark

David said:
Thomas said:
Garrett Smith wrote:
Beline wrote:
:
Beline wrote:
how to programmatically determine Adobe Acrobat PDF plug-in version
installed in Firefox and Opera?
Is it possible with Javascript?
[...]
Like flash, Acrobat is a plugin, however you should keep in mind that
Adobe Acrobat is not the only PDF viewer. Foxit, for example, Safari
has its own preview for PDF files that does not rely on any Adobe
plugin.
The web page might provide a link to the PDF and leave it up to the
user to download that or view it as he wishes (right click and save,
etc). It may be worth considering providing a link to a reader/plugin.
However, plugin detection appears to be rather easy to do in the targeted
environments using navigator.plugins.
Yes, but what would you do differently if the plug-in was detected (or
not).

There are several possibilities.

I realize that, but where PDF's are concerned (as opposed to Flash), I
can't think of a single good one.
 
T

Thomas 'PointedEars' Lahn

David said:
I realize that, but where PDF's are concerned (as opposed to Flash), I
can't think of a single good one.

For a simple example, you could use DOM scripting to remove the link to the
Adobe Reader download then. Then the Reader plugin is scriptable, of
course. And the Acrobat/Adobe Reader API supports scripting of PDF
documents with an ECMAScript implementation (called "JavaScript for
Acrobat")¹, so you could serve an enhanced document that makes use of that.


HTH

PointedEars
___________
¹ <http://www.adobe.com/devnet/acrobat/javascript.html>
 
D

David Mark

For a simple example, you could use DOM scripting to remove the link to the
Adobe Reader download then.

The downside is that detecting the PDF plug-ins (and their versions),
even in non-IE browsers appears to be non-trivial (if not impossible),
so you may remove a useful link. The upside would seem to be nil
(what harm can a link do?)
Then the Reader plugin is scriptable, of
course.

As is Flash. Of course, it's a complete nightmare. I wonder if
Acrobat plug-ins are any different.
And the Acrobat/Adobe Reader API supports scripting of PDF
documents with an ECMAScript implementation (called "JavaScript for
Acrobat")¹, so you could serve an enhanced document that makes use of that.

And what would you look at in the navigator object to determine
whether such an enhanced document is feasible? Assuming there is
answer to that, how about IE? Then I wonder if you can detect a
viewer that is not a browser plug-in.

And the OP asked simply for the version number, which (from reading a
cited treatise) appears to be impossible to nail down. And even if
you could nail it down, making inferences from version numbers is a
slippery slope (see also Flash).
 
T

Thomas 'PointedEars' Lahn

David said:
The downside is that detecting the PDF plug-ins (and their versions),
even in non-IE browsers appears to be non-trivial (if not impossible),

ACK, see below.
so you may remove a useful link. The upside would seem to be nil
(what harm can a link do?)

It was an *example*.
As is Flash. Of course, it's a complete nightmare. I wonder if
Acrobat plug-ins are any different.

Judging from their bogus introduction ("JavaScript 1.5, ... formerly known
as ECMAScript") I am inclined to say No, but that a thing can be labeled a
nightmare has not yet prevented anyone from using it when that was required.
And what would you look at in the navigator object to determine
whether such an enhanced document is feasible?

Perhaps navigator.plugins[n][m].type. You are right that this particular
plugin is apparently, unfortunately, silent about its version, so even
navigator.plugins[n].version is not useful here.

I had overlooked the version part in the original question and responded
only to whether it was possible to detect the plugin. However, once you
have detected the plugin, you could use feature-testing and maybe you can
access the object in the document to retrieve the plugin version.
Assuming there is answer to that, how about IE? [...]

IE/MSHTML is not among the target environments in this thread. Stop trying
to raise the bar, please, you are preaching to the choir.


PointedEars
 
D

David Mark

ACK, see below.


It was an *example*.

Yes, I was looking for a more pressing need to delve into this
problem.
Judging from their bogus introduction ("JavaScript 1.5, ... formerly known
as ECMAScript") I am inclined to say No, but that a thing can be labeled a
nightmare has not yet prevented anyone from using it when that was required.

No kidding. In just the last month I've had to deal with text ranges,
HTML5 audio, as well as Flash; all at the behest of clients. I'm
often called upon to make it all better (and I virtually always do
just that). ;)
And what would you look at in the navigator object to determine
whether such an enhanced document is feasible?

Perhaps navigator.plugins[n][m].type.  You are right that this particular
plugin is apparently, unfortunately, silent about its version, so even
navigator.plugins[n].version is not useful here.

I had overlooked the version part in the original question and responded
only to whether it was possible to detect the plugin.  However, once you
have detected the plugin, you could use feature-testing and maybe you can
access the object in the document to retrieve the plugin version.
Perhaps.
Assuming there is answer to that, how about IE? [...]

IE/MSHTML is not among the target environments in this thread.

Fair enough. I forgot that was the case.
Stop trying
to raise the bar, please, you are preaching to the choir.

Yes. I know you know. But without further explanation, the casual
reader may have been left wondering whether this was something they
should attempt or avoid.
 
B

Beline

I wouldn't count on it (at least not to explain it well). For
example, their Flash version detection is all tangled up in UA-based
browser sniffing.

That's not a solution. It's a pile of dated delusions.

function(){var $=this,nav=navigator,userAgent=
$.isString(nav.userAgent)?nav.userAgent:"",vendor=
$.isString(nav.vendor)?nav.vendor:"",platform=$.isString(nav.platform)?
nav.platform:"";$.OS=(/win/i).test(platform)?1:((/mac/
i).test(platform)?2:((/linux/i).test(platform)?3:4));$.convertFuncs($);
$.isIE=/*@cc_on!@*/false;$.IEver=$.isIE&&((/MSIE\s*(\d\.?\d*)/
i).exec(userAgent))?parseFloat(RegExp.
$1,10):-1;$.ActiveXEnabled=false;if($.isIE){ ...

"Note to users: I need some information from Macintosh users to
improve Adobe Reader detection. If you have a Macintosh with Adobe
Reader 8 installed, then with your Safari (and/or Firefox) browser, go
to this page. Select all the text on that page, copy, and paste into a
text file. Then email that text file to Eric Gerds . That would be a
big help to me. Please also mention the exact version of Adobe Reader
you have installed when you email me. BTW, I already have info on Mac/
Adobe Reader 7 & 9."

Another "test swarm". :)

From glancing at the rest of the article, the problem they are
attempting to solve (one observed browser at a time) may well be
impossible. In such a case, the only course of action is avoidance
(not continuing down the endless road they are on).

And if you think about it, you really can't know what sort of Acrobat
reader the end-user might have installed. Link to the PDF with a
disclaimer that links to Adobe's download page. Problem solved
(forever).
 
D

David Mark

here:http://www.pinlady.net/PluginDetect/AdobeReaderDetect.htm



That's not a solution.  It's a pile of dated delusions.

function(){var $=this,nav=navigator,userAgent=
$.isString(nav.userAgent)?nav.userAgent:"",vendor=
$.isString(nav.vendor)?nav.vendor:"",platform=$.isString(nav.platform)?
nav.platform:"";$.OS=(/win/i).test(platform)?1:((/mac/
i).test(platform)?2:((/linux/i).test(platform)?3:4));$.convertFuncs($);
$.isIE=/*@cc_on!@*/false;$.IEver=$.isIE&&((/MSIE\s*(\d\.?\d*)/
i).exec(userAgent))?parseFloat(RegExp.
$1,10):-1;$.ActiveXEnabled=false;if($.isIE){ ...

"Note to users: I need some information from Macintosh users to
improve Adobe Reader detection. If you have a Macintosh with Adobe
Reader 8 installed, then with your Safari (and/or Firefox) browser, go
to this page. Select all the text on that page, copy, and paste into a
text file. Then email that text file to Eric Gerds . That would be a
big help to me. Please also mention the exact version of Adobe Reader
you have installed when you email me. BTW, I already have info on Mac/
Adobe Reader 7 & 9."

Another "test swarm".  :)

From glancing at the rest of the article, the problem they are
attempting to solve (one observed browser at a time) may well be
impossible.  In such a case, the only course of action is avoidance
(not continuing down the endless road they are on).

And if you think about it, you really can't know what sort of Acrobat
reader the end-user might have installed.  Link to the PDF with a
disclaimer that links to Adobe's download page.  Problem solved
(forever).

Yes. See above.
It would be enough if script can detect version in 98-99%..

Well, as one noted industry "luminary" declared in a book, 1% of the
market is "infinitesimally small". Call it nothing. And two times
nothing is nothing, so you the chances of failure are virtually nil.
Of course, that's assuming you could measure such things, neither
browsers nor their plug-ins will ever change and that the
aforementioned book is a reliable source.

So you might want to reconsider your position. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top