如何嵌入PDF文件与响应宽度 [英] How to embed PDF file with responsive width

查看:449
本文介绍了如何嵌入PDF文件与响应宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这样的东西嵌入pdf文件:

I'm embedding pdf files using something like this:

<div class="graph-outline">
    <object style="width:100%;" data="path/to/file.pdf?#zoom=85&scrollbar=0&toolbar=0&navpanes=0" type="application/pdf">
    <embed src="path/to/file.pdf?#zoom=85&scrollbar=0&toolbar=0&navpanes=0" type="application/pdf" />
    </object>
</div>

它工作,但我想设置pdf宽度匹配包含div的宽度。目前它像一个iframe与滚动条,所以要查看整个pdf,你必须从右到左滚动。我想要的pdf适合容器的宽度。

It works but I want to set the pdf width to match the width of the containing div. Currently it shows up like an iframe with scrollbars, so to view the entire pdf, you have to scroll right to left. I want the pdf to fit the width of the container.

如何解决这个问题?我支持IE8及以上版本。

How do I fix this? I'm supporting IE8 and up.

这里是一个jsfiddle: http:/ /jsfiddle.net/s_d_p/KTkcj/

Here is a jsfiddle: http://jsfiddle.net/s_d_p/KTkcj/

推荐答案

只需执行以下操作: -

just simpl do this :-

 <object data="resume.pdf" type="application/pdf" width="100%" height="800px"> 
  <p>It appears you don't have a PDF plugin for this browser.
   No biggie... you can <a href="resume.pdf">click here to
  download the PDF file.</a></p>  
 </object>
 </div>

这篇关于如何嵌入PDF文件与响应宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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