EMBED vs. OBJECT
Which is the right/best tag to use in my HTML file when I want to display the Adobe PDF viewer? Right now I'm using the code below, but there are weird side effects (eg it seems to steal the starting focus that I've set to another INPUT text box; it doesn't seem to play real well with the jQueryUI Resizeable class; etc.)
<embed src="abc.pdf" type="application/pdf" />
Could I even do the same thing with the OBJECT tag? Are there advantages/disadvantages to using one tag vs. the other?
其他一些选项:
<object type="application/pdf" data="filename.pdf" width="100%" height="100%">
</object>
<object type="application/pdf" data="#request.localhost#_includes/filename.pdf"
width="100%" height="100%">
<param name="src" value="#request.localhost#_includes/filename.pdf">
</object>
You could also use the iframe method, although this is not cross browser compatible (eg. not working in chromium or android and probably others -> instead prompts to download). It works with dataURL's and normal URLS, not sure if the other examples work with dataURLS (please let me know if the other examples work with dataURLS?)
<iframe class="page-icon preview-pane" frameborder="0" height="352" width="396" src="data:application/pdf;base64, ..DATAURLHERE!... "></iframe>
链接地址: http://www.djcxy.com/p/6206.html
上一篇: Chrome在下载PDF时发送两个请求(并取消其中一个请求)
下一篇: 嵌入与对象