PHP Convert Word file to HTML without losing styling and images(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:
- 在 php 中将 MS Word 文档转换为 html
推荐答案
我花了一些时间来研究这个问题,我发现的最佳解决方案是安装 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP 在不丢失样式和图像的情况下将 Word 文件转换为 HTML


基础教程推荐
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- PHP 守护进程/worker 环境 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 使用 PDO 转义列名 2021-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01