显示pdf

Posted 酱油荷

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了显示pdf相关的知识,希望对你有一定的参考价值。

   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的主要内容,如果未能解决你的问题,请参考以下文章

Sphinx、reStructuredText 显示/隐藏代码片段

执行代码时有时不显示对话框片段

如何在 Resharper IntelliSense 中显示所有 Visual Studio 代码片段?

iText7高级教程之html2pdf——2.使用CSS定义样式

iText7高级教程之html2pdf——2.使用CSS定义样式

CSS 显示代码片段:使用PRE标记包裹长行