2016-03-02 59 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> 
相關問題