How do you display a formatted Word Doc in HTML/PHP?

后端 未结 3 966
醉梦人生
醉梦人生 2020-12-09 23:44

What is the best way to display a formatted Word Doc in HTML/PHP?

Here is the code I currently have but it doesn\'t format it:

$word = new COM(\"word         


        
3条回答
  •  不知归路
    2020-12-10 00:32

    I know nothing about COM, but poking around the Word API docs on MSDN, it looks like your best bet is going to be using Document.SaveAs to save as wsFormatFilteredHTML to a temporary file, then serving that HTML to the user. Be sure to pick the filtered HTML, otherwise you're going to get the soupiest tag soup ever.

提交回复
热议问题