我希望用户能够通过点击任何移动浏览器上的链接来查看pdf。我已经尝试过了,但是两者都给出了错误"This plugin is not supported“
<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>发布于 2018-06-14 18:56:52
你可以使用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>发布于 2018-06-14 19:04:35
如上所述,使用Google Docs Viewer。
工作示例:
<iframe src="https://docs.google.com/viewer?url=https://www.antennahouse.com/XSLsample/pdf/sample-link_1.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>将示例链接https://www.antennahouse.com/XSLsample/pdf/sample-link_1.pdf替换为您想要的任何PDF。
注意:的
如果您在以下位置收到此错误:
Mixed Content: The page at 'link' was loaded over HTTPS
确保你的链接中有https://。
https://stackoverflow.com/questions/50855747
复制相似问题