如何支持所有手机浏览器的PDF查看? [英] How to support PDF viewing for all mobile browser?

查看:42
本文介绍了如何支持所有手机浏览器的PDF查看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

<object>

在我的网站上嵌入一个 pdf 文件.例如

to embed a pdf file on my website. e.g.

<object data="abc.pdf" type="application/pdf">
    <embed src="abc.pdf" type="application/pdf" />
</object>

它适用于所有桌面浏览器,但在我的 android 设备上,它不显示任何内容.除了使用 google pdf 查看器(因为它大大降低了 pdf 质量),有没有办法支持所有 ios/android 设备浏览器?或者,处理这种情况的最佳方法是什么?由于有很多浏览器,我如何将它们重定向到浏览器的 pdf 插件下载页面,或者我应该告诉他们获取一个?(不太友好).谢谢

It works on all desktop browser, but on my android device, it does not show anything. Besides using the google pdf viewer (since it down-grade dramatically the pdf quality), are there any way to support all ios / android device browser? Or, what is the best way to handle this situation? Since there are lots of browser , How can I redirect them to the browser's pdf plugin download page , or should I just tell them to get one ? (Less user friendly). Thanks

推荐答案

最好的方法就是添加一个链接到 abc.pdf 它将在新选项卡上打开.这最适合移动浏览器,而不是嵌入或实现插件.

The best way is just too just add a link to the abc.pdf it will open on a new tab. This would work best for mobile browser rather than embeding or implementing plugins.

<a href="abc.pdf" target="_blank">ABC PDF file</a>

这篇关于如何支持所有手机浏览器的PDF查看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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