How to detect in Javascript if PDF-XChange is installed

The PDF-XChange Viewer for End Users
+++ FREE +++

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

djprice
User
Posts: 5
Joined: Tue Aug 18, 2009 11:53 am

How to detect in Javascript if PDF-XChange is installed

Post by djprice »

I need a method to detect if PDF-XChange is installed from IE. Here is what I am attempting but I am not sure of the name for the viewer to use in the ActiveXObject call so it is not found to be installed:

function isXChangeInstalled()
{
var isInstalled = false;
if (window.ActiveXObject)
{
// IE check
var control = false;
try
{
// Detects if PDF XChange reader is installed.
control = new ActiveXObject('PDF-XChange Viewer');
}
catch (e) { }
if (control)
{
isInstalled = true;
}
}
return(isInstalled);
}

How can I tell via javascript if the client browser has PDF XChange installed?
djprice
User
Posts: 5
Joined: Tue Aug 18, 2009 11:53 am

Re: How to detect in Javascript if PDF-XChange is installed

Post by djprice »

I figured it out in case anyone else needs this:

control = new ActiveXObject('PDFXCviewIEPlugin.CoPDFXCviewIEPlugin.1');
User avatar
Chris - PDF-XChange
Site Admin
Posts: 798
Joined: Tue Apr 14, 2009 11:33 pm

Re: How to detect in Javascript if PDF-XChange is installed

Post by Chris - PDF-XChange »

Good Job :)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.


Chris Attrell
Tracker Sales & Support North America
http://www.tracker-software.com