gpt4 book ai didi

javascript - 如何为移动浏览器添加 pdf 查看器到网站

转载 作者:行者123 更新时间:2023-12-03 01:40:40 26 4
gpt4 key购买 nike

我希望用户在任何移动浏览器上访问时都能够通过单击链接来查看 pdf。我已经尝试过,但都给出了“不支持此插件”的错误

<div id="pdf">
<iframe src="https://www.adobe.com/products/pdfjobready/pdfs/pdftraag.pdf" style="width: 100%; height: 100%;" frameborder="0" scrolling="no">
<p>It appears your web browser doesn't support iframes.</p>
</iframe>
</div>

<object data="lorem.pdf" type="application/pdf">
<p>It appears you don't have Adobe Reader or PDF support in this web browser. <a href="lorem.pdf">Click here to download the PDF</a>. Or <a href="http://get.adobe.com/reader/" target="_blank">click here to install Adobe Reader</a>.</p>
<embed src="lorem.pdf" type="application/pdf" />
</object>

最佳答案

您可以使用 Google 文档查看器

<iframe src="http://docs.google.com/viewer?url=" + PathToMyPdfFile + "&embedded=true" width="100%" height="100%" style="width: 100%; height: 100%;" frameborder="0" scrolling="no"></iframe>

关于javascript - 如何为移动浏览器添加 pdf 查看器到网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50855747/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com