HTML嵌入式PDF的&负载 [英] HTML Embedded PDF's & onload

查看:130
本文介绍了HTML嵌入式PDF的&负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下html将网页嵌入到网页中: -

 < object id =pdf classid =clsid:CA8A9780-280D-11CF-A24D-444553540000width =1024height =600> 
< param name =SRCvalue =/ GetDoc.ashx?SOID =<%= Html.Encode(Model.OrderID)%> />
< embed src =/ GetDoc.ashx?SOID =<%= Html.Encode(Model.OrderID)%> width =1024height =600>
< noembed>您的浏览器不支持嵌入式PDF文件。 < / NOEMBED>
< / embed>
< / object>

PDF的加载速度可能有点慢,所以我想隐藏对象并显示加载消息/ gif,直到它完全加载,这样用户不会看到空白屏幕。

我真正需要的是一种告诉对象何时完全加载的方式。我试过了'onload'事件,但它似乎从未被解雇。



我开始认为这可能是不可能的,但它永远不会受到伤害...

 < object 

data =yourfile.pdfstyle =background:transparent url(AnimatedLoading.gif)no-repeat center; type =application / pdf/>


I'm embedding a PDF in a web page with the following html :-

<object id="pdf" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="1024" height="600">
    <param name="SRC" value="/GetDoc.ashx?SOID=<%=Html.Encode(Model.OrderID)%>" />
    <embed src="/GetDoc.ashx?SOID=<%=Html.Encode(Model.OrderID)%>" width="1024" height="600">
        <noembed> Your browser does not support embedded PDF files. </noembed>                     
    </embed>
</object>

The PDF's can be a little slow to load so I'd like to hide the object and display a loading message / gif until it's fully loaded so the user isn't looking at a blank screen.

All I really need is a way of telling when the object is fully loaded. I've tried the 'onload' event of the but it never seems to get fired.

I'm beginning to think it might not be possible, but it never hurts to ask...

解决方案

I don't know why everyone makes it so hard.

<object data="yourfile.pdf" style="background: transparent url(AnimatedLoading.gif) no-repeat center;" type="application/pdf" />

这篇关于HTML嵌入式PDF的&amp;负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆