问题
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