2016-03-02 56 views
0

我的意图是显示嵌入aspx页面的PDF。为了使用浏览器和Firefox,我一直在试图在pdf内嵌入aspx两天,但由于某种原因,在浏览器中无法正常工作,所以我的第一步是为了执行测试而创建了一个html。我的HTML是:为什么这不在资源管理器中显示PDF?

<!DOCTYPE html> 
<html> 
<head> 

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

    <title>Preview</title> 
    <style type="text/css"> 
     html, body { 
      margin: 0; 
      padding: 0; 
      border: 0; 
      height: 100%; 
      overflow: hidden; 
     } 

     iframe { 
      width: 100%; 
      height: 100%; 
      border: 0; 
     } 
    </style> 
</head> 

<body>  
    <embed src="sample.pdf" width="500" height="375" type='application/pdf'> 
</body> 
</html> 

在资源管理器无法正常工作和Firefox工程,以便 我是什么mising?

+1

“资源管理器”是你的“Microsoft Internet Explorer”的简写?如果是这样,什么版本?你知道吗[微软正在淘汰Internet Explorer](http://www.techinsider.io/microsoft-phasing-out-internet-explorer-2016-1)? – usr2564301

回答

2

尝试这样的事情

客户端必须在浏览器中显示PDF文件的插件。如果他没有,你可以写一条消息,目的是下载...

<object data="sample.pdf" type="application/pdf" width="100%" height="100%"> 

    <p>You have no plugin PDF viewer <a href="sample.pdf"> 
    download the PDF file.</a></p> 

</object> 
相关问题