电脑在没有装pdf阅读器,网页中嵌入的pdf不能显示,这时,我想弹出个提示,安装PDF插件?

解决方案 »

  1.   

    http://topic.csdn.net/u/20091109/10/278c55dc-0489-4214-a407-1006664a806d.html
      

  2.   

    我现在的pdf文件在网页上,已经能正常显示了,现在是如何判断客户端ie是否安装了pdf文件阅读器……
      

  3.   

    <script type="text/javascript">
            function isAcrobatPluginInstall() {
                //Firefox
                if (navigator.plugins && navigator.plugins.length) {
                    for (x = 0; x < navigator.plugins.length; x++) {
                        if (navigator.plugins[x].name == 'Adobe Acrobat')
                            return true;
                    }
                }
                //IE
                else if (window.ActiveXObject) {
                    for (x = 2; x < 10; x++) {
                        try {
                            oAcro = eval("new ActiveXObject('PDF.PdfCtrl." + x + "');");
                            if (oAcro) {
                                return true;
                            }
                        }
                        catch (e) { }
                    }
                    try {
                        oAcro4 = new ActiveXObject('PDF.PdfCtrl.1');
                        if (oAcro4) {
                            return true;
                        }
                    }
                    catch (e) { }
                    try {
                        oAcro7 = new ActiveXObject('AcroPDF.PDF.1');
                        if (oAcro7)
                            return true;
                    }
                    catch (e) { }
                }
            }
            if (!isAcrobatPluginInstall()) {
                alert('您的电脑没有安装PDF阅读器,PDF文档无法打开!');
            }        
        </script>