如何在网页中嵌入 Google 文档?
我使用它的直接链接嵌入该文档。这是代码:
<iframe src="http://docs.google.com/viewer?url=mco2008030016.pdf&embedded=true" style="width: 718px; height: 700px;" frameborder="0"></iframe>
但是我收到以下错误:
Sorry,we are unable to retrieve the document for viewing or you dont have permission to view the document.
如何正确嵌入此文件?
I embed the document using it's direct link. Here is the code:
<iframe src="http://docs.google.com/viewer?url=mco2008030016.pdf&embedded=true" style="width: 718px; height: 700px;" frameborder="0"></iframe>
However I get the following error:
Sorry,we are unable to retrieve the document for viewing or you dont have permission to view the document.
How can I embed this file properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建文档并使其可供公开访问。点击此链接将其公开 http://www.wikihow.com/Make- a-Google-Doc-公共
然后复制为公共使用而创建的链接并将其嵌入到 iFrame(用于网络)中。这对我有用。
You can create a document and make it publicly accessible. Follow this link to make it public http://www.wikihow.com/Make-a-Google-Doc-Public
Then copy the link which gets created for public use and embed it in a iFrame(for web). It worked for me.
最可能的原因是,当您尝试自己查看 PDF 时,您已授权访问您的 Google 文档。当您将文件嵌入 iFrame 中时,它会认为您尚未登录(从技术上讲,这是由会话引起的)。
可能的解决方案是:
The most probable reason for this is because when you try to view the PDF yourself, you have authorized access to your Google Docs. When you embed the file in an iFrame, it thinks you're not logged in yet (technically, this is caused by sessions).
Possible solutions are: