javascript - Google 云端硬盘未加载 pdf 链接

标签 javascript html

我与知道链接的任何人共享了 Google Drive 上文件的链接,但由于某种原因我的 PDF 没有显示。它适用于其他人的 Google 云端硬盘链接,但不适用于我的链接。

我尝试在 Google 云端硬盘的用户界面上与整个互联网共享它,但没有任何改变。只是一个空白页。

<!-- simple.html -->
<!DOCTYPE html>
<html>
    <head>
        <title>Google Drive not Working for Me</title>
    </head>
    <body>
        <object data="https://drive.google.com/file/d/10IcEechL2QV5enxoec-B5jhfCaJ9xkzU/view?usp=sharing"  width="600" height="750">
            <embed src="https://drive.google.com/file/d/10IcEechL2QV5enxoec-B5jhfCaJ9xkzU/view?usp=sharing" width="600px" height="750px" />
            <p>This browser does not support PDFs. Please download the PDF to view it: <a href="https://drive.google.com/file/d/10IcEechL2QV5enxoec-B5jhfCaJ9xkzU/view?usp=sharing">View the PDF</a>.</p>
        </embed>
        </object>
    </body>
</html>

我想查看我的 PDF,但我看到的只是一个空白页。

这是 My Page不工作。

这是 Someone else's Google Drive Link Working

最佳答案

将 URL 与 /preview 一起使用,而不是像您的示例中那样使用 /view

https://drive.google.com/file/d/{fileId}/preview

关于javascript - Google 云端硬盘未加载 pdf 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57048935/

相关文章:

html - firefox的localstorage目录是哪个物理目录?

html - 如何使用 css 在 html 页面中添加 3 列?

html - 在 FF 中强制下载而不是流式传输 mp3 文件

javascript - 通过 JavaScript 或 jQuery 控制 CSS

javascript - 幻灯片中的图片未显示

c# - JavaScript CheckBox 无法获取 OnCheckChange 来调用方法

html - 在输入组内选择的顶部显示跨度

javascript - 检查 'click' 事件上的 Ctrl/Shift/Alt 键

javascript - D3 - 使笔画宽度与第二个数据集共变

javascript - 如何在html2canvas中将dom下载为svg?