码迷,mamicode.com
首页 > 其他好文 > 详细

显示pdf

时间:2016-06-17 09:46:52      阅读:352      评论:0      收藏:0      [点我收藏+]

标签:

   document.all[document.all.PDFNotKnown ? "IfNoAcrobat" : "IfAcrobat"].style.display = "block";

 

@{
    Layout = null;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>健康体检网上服务平台</title>
    <script src="../Scripts/jquery-1.7.1.js"></script>
    <script>
        $(function () {
            if ($(#reportUrl) != null) {
                var url = $(#reportUrl).val();
                if (url == null || url.length == 0) {
                    alert("还未出报告或报告有错误,请联系相关人员");
                }
            }
            else {
                alert("还未出报告或报告有错误,请联系相关人员");
            }

            document.all[document.all.PDFNotKnown ? "IfNoAcrobat" : "IfAcrobat"].style.display = "block";
        });
    </script>
</head>
<body>
    <div id="showdiv">
        @if (ViewData["ReportUrl"] != null)
        {
            <div>
                <input type="hidden" value="@ViewData["ReportUrl"]" id="reportUrl" />
            </div>
        }
        @*<iframe src="@ViewData["ReportUrl"]" style="width:100%;height:700px;border:0;"></iframe> *@
        <noscript>
            Cannot determine if you have Acrobat Reader (or the full Acrobat) 
            installed <font size="-1">(because JavaScript is unavailable or 
            turned off)</font>. 
        </noscript>
        <div id="IfNoAcrobat" style="display: none">
            <a href="http://get.adobe.com/cn/reader/">你需要先安装Adobe Reader才能正常浏览文件,请点击这里下载Adobe Reader.</a>
        </div>
        <object type="application/pdf" style="display: none; width: 0; height: 0;">
            <div id="PDFNotKnown" style="display: none">&nbsp;</div>
        </object>
        <div id="IfAcrobat">
            <object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="100%" height="700px;" border="0" name="pdf">
                <param name="toolbar" value="false">
                <param name="_Version" value="65539">

                <param name="_ExtentX" value="20108">

                <param name="_ExtentY" value="10866">

                <param name="_StockProps" value="0">

                <param name="SRC" id="pdfName" value="@ViewData["ReportUrl"]">
            </object>
        </div>
    </div>
</body>
</html>


技术分享

 

显示pdf

标签:

原文地址:http://www.cnblogs.com/jiangyou-lz/p/5592928.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!