PHP将Word文件转换为HTML而不丢失样式和图像 [英] PHP Convert Word file to HTML without losing styling and images

查看:957
本文介绍了PHP将Word文件转换为HTML而不丢失样式和图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有用于将单词文件转换为HTML而不丢失格式的API?

Is there an API for converting word files to HTML without losing the format?

Google文档API可以用于此吗?

Can the google documents API be used for this?

我尝试了saaspose,但返回的结果始终是服务器错误.

I tried saaspose but the returning result is always a server error.

不适用于我的解决方案:

Solutions that did not work for me:

推荐答案

我花了一些时间寻找这个问题,而我发现的最佳解决方案是安装unoconv ,并使用PHP通过系统调用与其进行交互.

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.

我很想为此找到一个很好的本机PHP解决方案,但不幸的是我没有.

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

修改 自从最初回答这个问题以来,我遇到了一个Web服务,该服务提供了一个用于转换文档的API.我尚未对其进行非常彻底的测试,但是在将Word转换为HTML时,它确实产生了不错的结果: CloudConvert .

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.

这篇关于PHP将Word文件转换为HTML而不丢失样式和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆