How can I convert a docx document to html using php?

前端 未结 4 1333
萌比男神i
萌比男神i 2020-11-29 05:14

I want to be able to upload an MS word document and export it a page in my site.

Is there any way to accomplish this?

4条回答
  •  旧时难觅i
    2020-11-29 06:03

    You can convert Word docx documents to html using Print2flash library. Here is an PHP excerpt from my client's site which converts a document to html:

    include("const.php");
    $p2fServ = new COM("Print2Flash4.Server2");
    $p2fServ->DefaultProfile->DocumentType=HTML5;
    $p2fServ->ConvertFile($wordfile,$htmlFile);
    

    It converts a document which path is specified in $wordfile variable to a html page file specified by $htmlFile variable. All formatting, hyperlinks and charts are retained. You can get the required const.php file altogether with a fuller sample from Print2flash SDK.

提交回复
热议问题