如何在Chrome / Firefox浏览PDF使用开放的参数(例如FITH)? [英] How to use PDF open parameter (e.g. fitH) in Chrome/ FireFox browser?

查看:1573
本文介绍了如何在Chrome / Firefox浏览PDF使用开放的参数(例如FITH)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

有一组公开参数指定浏览器如何打开PDF文件。然而,随着Chrome和Firefox浏览器的默认浏览器,这是行不通的。

 <对象ID ='zoomPage'型='应用程序/ PDF'数据='次数1.pdf#查看=适合'>< P>该PDF不能显示< / p>< /对象>

我都试过,我想的PDF填充对象的配合。如果没有参数的支持,还有什么解决方法吗?我尝试了很多方法的,但他们没有工作。例如,我也用的iframe,而不是对象的尝试。但是,内容不调整大小。谢谢

 < IFRAME SRC =次数1.pdfWIDTH = 1300 HEIGHT = 3300>< / IFRAME>


解决方案

搜索非常相似,你的问题的解决方案,我发现forum.asp.net一个有趣的线程。的http://forums.asp.net/t/1877403.aspx?Issue+with+embedded+pdf+object+in+chrome+browsers

在页面的最后,有一种变通方法在Chrome中工作顺利的用户。这似乎解决问题。

这是一个例子:

 < IFRAME SRC =/下载/ MyPdfDocument.pdf#查看= FITHWIDTH =700HEIGHT =880>< / IFRAME>

有关用户 http://pdfobject.com/ 战斗 - >pdfobject.js你像我一样可以改变两个缩小的code的几行代码,开发pdfobject版本。

查找:

  c.innerHTML ='<对象数据=+ A +'类型=应用/ PDFWIDTH =+ I +'HEIGHT ='+ Z + >&下; /对象>';返回c.getElementsByTagName(对象)[0];

和这一行code的变化:

  c.innerHTML ='< IFRAME SRC =+ A +'WIDTH =+ I +'HEIGHT ='+ Z +'>< / IFRAME&GT ;';返回c.getElementsByTagName(IFRAME)[0];

希望这有助于。

http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

There are a set of open parameter specify how the viewer should open the pdf . However, with the Chrome and firefox browser's default viewer , it does not work

<object id = 'zoomPage' type='application/pdf' data= '1.pdf#view=fit'><p>The PDF can not display</p></object>

I have tried the fit which I would like the pdf fill the object. If there is no parameter support , are there any workaround ? I tried a lot of approach but none of them work. For example, I also tried using iframe instead of object. However, the content does not resize. Thanks

<iframe src="1.pdf" width=1300 height=3300></iframe>

解决方案

Searching a solution for a problem very similar to yours, I found an interesting thread on forum.asp.net. http://forums.asp.net/t/1877403.aspx?Issue+with+embedded+pdf+object+in+chrome+browsers

At the end of the page, there is a workaround by a user working smoothly in Chrome. That seems to solve the problem.

Here it is an example:

<iframe src="/Downloads/MyPdfDocument.pdf#view=fitH" width="700"  height="880"></iframe>

For users fighting with http://pdfobject.com/ -> "pdfobject.js" like me, you can change few lines of code on both minified and develop version of pdfobject.

Find:

c.innerHTML='<object    data="'+a+'" type="application/pdf" width="'+i+'" height="'+z+'"></object>';return c.getElementsByTagName("object")[0];

and change with this line of code:

c.innerHTML='<iframe src="'+a+'" width="'+i+'" height="'+z+'"></iframe>';return c.getElementsByTagName("iframe")[0];

Hope this helps.

这篇关于如何在Chrome / Firefox浏览PDF使用开放的参数(例如FITH)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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