iFrame里面的PDF不适用于iOS

时间:2016-07-16 10:50:04

标签: javascript ios pdf iframe

我一直在尝试在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}

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

1 个答案:

答案 0 :(得分:0)

如果您不需要https,则可以使用google docs viewer

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

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