How to Add google doc viewer in mvc4 Applicaton?

╄→гoц情女王★ 提交于 2019-12-11 19:19:26

问题


I am beginner in programming. My problem is, I want to show PDF files in Google Doc Viewer in my website page. I put my PDF files in folder named as Bullettin, it is in App_Data folder.

How can I view this PDF file in my website through Google Doc Viewer using C# MVC4 application?

i used the following code in view page http://docs.google.com/viewer?url=http://localhost:3907/App_Data/Bullettin/JCI.pdf&embedded=true" target="_blank" class="embed">View


回答1:


You should use the following url for embed: http://docs.google.com/viewer?url=http://localhost:3907/App_Data/Bullettin/JCI.pdf for previews

and: <a href="http://docs.google.com/viewer?url=http://localhost:3907/App_Data/Bullettin/JCI.pdf&embedded=true" target="_blank">Preview</a>

for links, and finally:

<iframe src="http://docs.google.com/viewer?url=http://localhost:3907/App_Data/Bullettin/JCI.pdf&embedded=true"></iframe>

For Iframes.

Well, localhost will not work for you, so get your project on a live server or use an IP address to link your server.

Good luck with it.



来源:https://stackoverflow.com/questions/16953229/how-to-add-google-doc-viewer-in-mvc4-applicaton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!