缩放以适合:PDF嵌入HTML [英] Zoom to fit: PDF Embedded in HTML

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

问题描述

我将一个本地pdf文件嵌入到一个简单的网页中,我正在设置初始缩放以适应对象大小。这是我试过的,但它不影响缩放。

 < embed src =filename.pdf?zoom = 50 width =575height =500> 

没有人知道如何修改代码,以便其初始缩放设置为适合对象大小。 / p>

解决方案

有点迟了,但我注意到这个信息可能很难找到并且没有在SO上找到答案,所以在这里。



尝试一个不同的参数#view = FitH强制它适合horzontal空间,同时你需要用#而不是querystring开始比&使它:

  filename.pdf#view = FitH 

我注意到,如果adobe阅读器嵌入在浏览器中,但它会使用它自己的阅读器版本并且不会响应办法。在我自己的情况下,默认情况下,Chrome浏览器放大以适应宽度,所以没有问题,但Internet Explorer需要上述参数来确保链接始终以正确的视图设置打开PDF页面。



有关可用参数的完整列表,请参阅此




I am embedding a local pdf file into a simple webpage and I am looking to set the initial zoom to fit to the object size. Here is what I tried but it is not affecting the zoom.

 <embed src="filename.pdf?zoom=50" width="575" height="500">

does anyone know how to modify the code so its initial zoom is set to fit the object size.

解决方案

Bit of a late response but I noticed that this information can be hard to find and haven't found the answer on SO, so here it is.

Try a differnt parameter #view=FitH to force it to fit in the horzontal space and also you need to start the querystring off with a # rather than an & making it:

filename.pdf#view=FitH

What I've noticed it is that this will work if adobe reader is embedded in the browser but chrome will use it's own version of the reader and won't respond in the same way. In my own case, the chrome browser zoomed to fit width by default, so no problem , but Internet Explorer needed the above parameters to ensure the link always opened the pdf page with the correct view setting.

For a full list of available parameters see this doc

EDIT: (lazy mode on)

这篇关于缩放以适合:PDF嵌入HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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