iFrame 中的 PDF 不适用于 iOS

use*_*648 5 javascript pdf iframe ios

我一直在尝试在 iFrame 中显示 PDF,它适用于所有其他浏览器和平台,但不适用于 iOS。当我尝试在 iPhone/iPad 中的 chrome/Safari 中访问时,它显示第一页但不允许向下滚动 PDF。当涉及到 iFrame 中的 HTML 时,它可以完美运行,根据我的观察,问题似乎出在 iOS 上 iFrame 中的 PDF 上。尝试了各种网站上提供的所有链接、自动溢出、webkit 滚动、仅滚动 y 轴、绝对/相对位置增加高度导致白页和所有其他可能的解决方案,但还没有运气。实现语言是 ASP.NET-C#,我在其中动态设置 iFrame 源。以下是我试图实现上述任务的来源。

<div id="wrapper" class="Sales-container container">
    <iframe runat="server" id="Contents" class="myiframe" scrolling="no" width="100%" height="100%" frameborder="0" />        
</div>


.Sales-container{position:absolute !important;width:100%}

.container{margin-right:auto;margin-left:auto;padding-left:7px;padding-right:8px}

.myiframe{z-index:0;white-space:nowrap}
Run Code Online (Sandbox Code Playgroud)

任何帮助将非常感激。谢谢。

小智 3

如果不需要 https,可以使用 google docs 查看器

使 src http://docs.google.com/gview?url=YOURADDRESSHERE&embedded=true

如果这对你不起作用,我目前正在研究 pdf.js