如何使用Google Viewr doc显示存储在localhost中的pdf? [英] How do I show a pdf stored in my localhost using Google Viewr doc?

查看:69
本文介绍了如何使用Google Viewr doc显示存储在localhost中的pdf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Google Viewer Doc来显示pdf,但是当我尝试显示存储在LocalHost中的pdf时,它说:抱歉,我们无法找到该文档......



这是我的代码。



I am using Google Viewer Doc, to show pdf's, but when I try show a pdf stored in my LocalHost it says, "Sorry, we were unable to find the document..."

This is my code.

<iframe src="http://docs.google.com/viewer?url=http://localhost/CardMarte/Documents/Datacode-VISA.pdf&embedded=true" frameborder="1" style="width: 100px; height: 550px;" id="ctIframe"  runat="server">
</iframe>





我需要做什么才能正确显示我的PDF格式?



What I have to do to display my pdf correctly?

推荐答案

正如Valery Possoz在您的评论中发布的那样,您不能。



Google Docs通过从URL加载文档来工作。 Localhost仅适用于您的本地计算机,不适用于外部世界。 Google无法访问您的计算机并从localhost URL加载文档。



有一些方法可以解决这个问题,例如使用动态DNS( DynDNS例如 [ ^ ])。这将要求您在计算机上安装更新DNS条目的客户端。然后,您可以使用动态DNS名称来引用您的计算机和文件的位置。这可能还需要您的路由器或调制解调器进行一些复杂的设置,以允许HTTP流量传递到正确的计算机。
As Valery Possoz posted in your comment, you can't.

Google Docs works by loading a document from a URL. Localhost is only available to your local computer, not to the outside world. Google can't access your computer and load the document from the localhost URL.

There are some ways you can get around this, like using a Dynamic DNS (DynDNS for example[^]). This will require you to install a client on your computer that updates a DNS entry. You then use the dynamic dns name to refer to your computer and the location of your file. This may also require some complicated setup with your router or modem to allow HTTP traffic to pass to the right computer.


这篇关于如何使用Google Viewr doc显示存储在localhost中的pdf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆