检查是否安装客户端机器上的Adobe Reader [英] Check if adobe reader is installed on client machine

查看:247
本文介绍了检查是否安装客户端机器上的Adobe Reader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在一个网页,会告诉用户关于客户端计算机上某些配置上。出于这个也有,如果安装了客户端计算机上或没有Adobe Reader检测要求。我使用ASP.NET/C#。

Currently I am working on a web page which will tell user about certain configurations on client machine. Out of this there is also requirement of detecting if Adobe Reader is installed on client machine or not. I am using ASP.NET/C#.

我已经看过以下网址的答案
http://stackoverflow.com/questions/969027/check-adobe-reader-is-installed-c,但code外观到服务器注册表entires那里IIS安装而不是客户端机器在那里浏览器运行

I have looked the following url for the answer "http://stackoverflow.com/questions/969027/check-adobe-reader-is-installed-c" but the code look into the server registry entires where IIS is installed and not the client machine where browser is running.

是否有可能在安装客户机上的Adobe Reader和检测不是服务器,托管的网站的?

Is it possible to detect if Adobe reader is installed on client machine and not the server which is hosting the website?

推荐答案

请检查下面的脚本,它在IE,火狐和Chrome的工作对我罚款

pls, check the script below, it worked fine for me in IE, FireFox and Chrome

<html>
<body>
<script type="text/javascript">
var found = false;
var info = '';

try 
{    
    acrobat4 = new ActiveXObject('PDF.PdfCtrl.1');    
    if (acrobat4) 
    {      
    	found = true;      
    	info = 'v. 4.0';    
    }  
}  
catch (e) 
{
    //???
}

if (!found)
{
    try 
    {
    	acrobat7 = new ActiveXObject('AcroPDF.PDF.1');
    	if (acrobat7) 
    	{
    		found = true;
    		info = 'v. 7+';
    	}
    } 
    catch (e) 
    {
    	//???
    }

    if (!found && navigator.plugins && navigator.plugins.length>0)
    {
    	for (var i = 0; i<navigator.plugins.length; i++) 
    	{    						
    		if (navigator.plugins[i].name.indexOf('Adobe Acrobat') > -1)
    		{
    			found = true; 
    			info = navigator.plugins[i].description + ' (' + navigator.plugins[i].filename + ')';
    			break;
    		}
    	}
    }
}

document.write("Acrobat Reader Installed : " + found);
document.write("<br />");
if (found) document.write("Info : " + info);
</script>
</body>
</html>

希望这可以帮助,至于

hope this helps, regards

这篇关于检查是否安装客户端机器上的Adobe Reader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆