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

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

问题描述

是否有将word文件转换为HTML而不丢失格式的API?

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

谷歌文档 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天全站免登陆