代码之家  ›  专栏  ›  技术社区  ›  Willie Cheng danbulochkin

如何使用浏览器在Firefox/IE/Chrome中显示ppt/doc/xls/pdf

  •  2
  • Willie Cheng danbulochkin  · 技术社区  · 10 年前

    在我的Html标签上,我有一个URL( http://infolab.stanford.edu/pub/papers/google.pdf )想在浏览器上打开它而不下载,我该怎么做,请帮助我解决这个问题?

    PS:我已经找到了谷歌API的解决方案

    2 回复  |  直到 10 年前
        1
  •  4
  •   Willie Cheng danbulochkin    10 年前

    我一直在寻找一种很棒且简单的方式来展示*。PPT/*。PDF/*。XLS/*。浏览器中的DOC,希望这个方法可以帮助像我这样有相同问题的每个人,如下面的示例代码

    <iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
    
    <iframe src="http://docs.google.com/gview?url=http://download.ppt-to-dvd.com/tem/wedding2.potx&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
    
    <iframe src="http://docs.google.com/gview?url=http://www.ysnp.gov.tw/upload/%E4%B8%AD%E8%8B%B1%E8%A9%9E%E5%BD%99%E5%B0%8D%E7%85%A7%E8%A1%A8.doc&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
    
    <iframe src="http://docs.google.com/gview?url=http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
    
        2
  •  4
  •   Community Mohan Dere    9 年前

    嗨,你可以使用object元素来显示pdf、doc等,比如

    <object data="xx.pdf" type="application/pdf">
        <embed src="xx.pdf" type="application/pdf" />
    </object>
    

    有关更多信息,请查看 link