PHP Convert Word file to HTML without losing styling and images [closed]

故事扮演 提交于 2019-11-30 03:16:45

I've spent a bit of time loking into this, and the best solution that I've found was to install unoconv on the server, and using PHP to interface with it through system calls.

I would have loved to find a good native PHP solution for this, but unfortunately I couldn't.

Edit Since originally answering this, I've come across a web service which presents an API for converting documents. I haven't tested it very thoroughly but it does seem to produce decent results at converting Word to HTML: CloudConvert.

Try PHPWord lib. According to site it is based on PHPExcel Lib which perfectly read/write excelsheets.

PHPDocx has a solution. According to site you may extract data directly from any database or spreadsheet and export them to other popular formats (PDF, DOC, HTML, ODT, ...) with the help of the conversion plugin. These reports may include editable graphs (only docx), images, tables, headers, footers, etcetera.

Am not sure how good it can convert word to html

The best solution I've found so far is http://www.phplivedocx.org/ . You use it with the Zend framework. Very easy to set up and you get minimal deviation from the actual word format. It converts word docs to html very well.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!