在不使用内置PDF查看器的情况下将PDF嵌入到网页中 [英] Embed the PDF in a webpage without using the built-in PDF viewer

查看:156
本文介绍了在不使用内置PDF查看器的情况下将PDF嵌入到网页中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我正在使用标准方式将pdf嵌入到浏览器中,但是,我的目标浏览器的内置PDF查看器无法按预期工作。我想强制(Chrome,Firefox和IE8(如果可能,但IE9 +也可以))使用Adobe Reader。问题是,我只能手动更改此选项。有什么方法可以更改HTML / JS / PHP中的选项吗?

 < OBJECT data =YourFile.pdfTYPE =application / x-pdfTITLE =SamplePdf 
WIDTH = 200 HEIGHT = 100>
< a href =YourFile.pdf> shree< / a>
< / object>

我尝试找到解决方案和某人建议的标题,但不幸运,例如

  Content-Type:application / pdf 
Content-Disposition:inline; filename.pdf


解决方案

使用JQuery是解决这个问题的好方法:)

pdf.js:



https://github.com/mozilla/pdf.js



希望这有助于!


Currently I am using the standard way to embed an pdf to the browser, however, the built-in pdf viewer for my target browser is not working as expected. I would like to force (Chrome, Firefox and IE8 (if possible, but IE9+ is also ok)) to use the adobe reader. The problem is , I can only change this option manually. Is there any way to change the option in HTML/ JS/ PHP ? Thanks.

<OBJECT data="YourFile.pdf" TYPE="application/x-pdf" TITLE="SamplePdf" 
WIDTH=200 HEIGHT=100>
    <a href="YourFile.pdf">shree</a> 
</object>

I try to find the solution and someone suggested header, not working unfortunately e.g.

Content-Type: application/pdf
Content-Disposition: inline; filename.pdf

解决方案

I did this a while ago. Using JQuery was a great way to get round this :)

pdf.js:

https://github.com/mozilla/pdf.js

Hope this helps!

这篇关于在不使用内置PDF查看器的情况下将PDF嵌入到网页中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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