简体   繁体   English

使用php或html在网络浏览器上显示ms文档

[英]Display ms document on a web browser using php or html

How can I display an ms word document to a web browser just like the way an image is displayed in html . 如何将ms word文档显示到Web浏览器,就像在html中显示图像的方式一样。 I am using php and html , I tried it using iframe but my idea did not work . 我正在使用php和html,但是我使用iframe尝试了一下,但是我的想法没有用。

<iframe name="houses" src="report.doc" width="580"></iframe>

try this : 尝试这个 :

<?php
        $word = new COM("word.application") or die ("Could not initialise MS Word object.");
        $word->Documents->Open(realpath("Sample.doc"));

        // Extract content.
        $content = (string) $word->ActiveDocument->Content;

        echo $content;

        $word->ActiveDocument->Close(false);

        $word->Quit();
        $word = null;
        unset($word);   
?>

for More Info Refer this 有关更多信息,请参考

您可以使用Google文档:

<iframe src="http://docs.google.com/gview?url=http://www.example.com/report.doc"></iframe>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM