[英]How to embed a pdf file from firebase storage in html(react) in mobile browsers
[英]embed tag not displaying pdf file on mobile browsers
我使用embed标签在我的html页面上显示pdf文件,它在桌面和笔记本电脑浏览器上显示pdf文件但是没有在moblie和talbets上显示pdf文件,有什么方法可以让它们出现在手机上也是如此。 以下是相关代码:
<embed src="assets/img/jimbosmenu.pdf" width="900" height="900">
这是实时页面的链接。 http://jimbosjoint.com/menu
你需要使用object
,而不是embed
<object data="filename.pdf" type="application/pdf" width="100%" height="100%">
<p>Your web browser doesn't have a PDF plugin.
Instead you can <a href="filename.pdf">click here to
download the PDF file.</a></p>
</object>
从谷歌文档中显示它:
<object width="900" height="900" data="https://docs.google.com/gview?embedded=true&url=http://jimbosjoint.com/assets/img/jimbosmenu.pdf"></object>
<embed>
标签已过时。 考虑使用<object>
标记。 但是,链接到PDF文件可能是更好的选择,因此移动用户可以全屏查看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.