简体   繁体   English

将html转换为ms_word格式

[英]convert html to ms_word format

如何将“ html代码”转换为Unix OS的php中的.doc或.rtf或其他Office文件格式?

There is a PEAR library to read/write OpenDocument Format which is also supported by MS-Office 2007 (or MS-Office 2000/2003 through plugins). 有一个PEAR库可以读取/写入OpenDocument格式 ,MS-Office 2007(或MS-Office 2000/2003通过插件)也支持该 And here is an RTF library for PHP. 这是用于PHP 的RTF库 I don't know of any libraries that can write .doc files directly but that is probably because .doc files are very complicated to write. 我不知道任何可以直接写入.doc文件的库,但这可能是因为.doc文件的编写非常复杂。

You could also write out ODF or OOXML by hand. 您也可以手动写出ODF或OOXML。 After all, it's just a zip file with a bunch of XML files in there. 毕竟,它只是一个zip文件,其中有一堆XML文件。 PHP has excellent support for manipulating zip files. PHP对操作zip文件具有出色的支持。 I haven't read the OOXML spec but it's not that complicated to generate a simple ODF file by hand. 我还没有阅读OOXML规范,但是手动生成一个简单的ODF文件并不那么复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM