简体   繁体   English

使用PHP在Rhel 4服务器上将.doc和.xls文件转换为html

[英]converting .doc and .xls file to html on rhel 4 server using php

i have a rhel 4 server and use php as a server side scripting language. 我有一个rhel 4服务器,并使用php作为服务器端脚本语言。 There are many doc and excel files that are uploaded to the server daily. 每天都有许多doc和excel文件上载到服务器。 i make these files to be downloaded. 我将这些文件下载。 i want to implement the view as html feature and they should preserve the formatting also. 我想将视图实现为html功能,它们也应保留格式。 so which tools can be used or it can be done through php only. 因此,可以使用哪些工具,或者只能通过php完成。 (on php4) (在php4上)

Good luck. 祝好运。

These are a large set of undocumented and different formats, mostly based around OLE. 这些是大量未记录且不同的格式,主要基于OLE。

You might want to have a look at wv (converts .doc files to HTML see http://wvware.sourceforge.net/ ) ISR that there is a similar tool for Excel - but google just turns up the usual crapware sites. 您可能想看一下wv(将.doc文件转换为HTML,请参阅http://wvware.sourceforge.net/)ISR ,它有一个类似的Excel工具-但是google只是打开了常用的垃圾网站。

Alternatively you might want to use OpenOffice to perform conversions - it can be scripted / called via mono interface. 另外,您可能希望使用OpenOffice进行转换-可以通过Mono接口编写脚本/调用它。

HTH 高温超导

C. C。

我建议使用wv(由symcbean提及)和xlhtml, http://sourceforge.net/projects/chicago/

We do this using jodconverter which acts as a service utilizing openoffice. 我们使用jodconverter进行此操作,该服务充当利用openoffice的服务。 You can check for yourself, if openoffice exports with enough "preserveness". 您可以自行检查openoffice是否以足够的“保留”方式导出。 It will always be changed slightly as the width of a webpage is so different from that of a piece of paper, but it is pretty good I would say. 由于网页的宽度与纸的宽度相差很大,因此它总是会稍有变化,但是我要说的很好。

They don´t have support for the .XLS part, but you can take a look at the PHP LiveDocX for the HTML conversion. 他们不支持.XLS部分,但是您可以看一下HTML转换的PHP LiveDocX

It´sa webservice that supports various formats of input (docx, doc, rtf, txt) and output (docx, doc, html, pdf, jpg, gif...). 这是一个Web服务,支持各种格式的输入(docx,doc,rtf,txt)和输出(docx,doc,html,pdf,jpg,gif ...)。

It´s now part of the Zend Framework services . 现在,它已成为Zend Framework服务的一部分

For doc files, another alternative thats little simpler (but not as robust) to implement is Abiword. 对于doc文件,另一种实现起来更简单(但不那么健壮)的方法是Abiword。 you can call the Abiword executable via commandline w/ parameters to convert the doc to HTML or other formats. 您可以通过带有参数的命令行调用Abiword可执行文件,以将文档转换为HTML或其他格式。

http://opensource.weblogsinc.com/2005/06/29/use-abiword-to-convert-filetypes-on-the-command-line/ http://opensource.weblogsinc.com/2005/06/29/use-abiword-to-convert-filetypes-on-the-command-line/

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

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