简体   繁体   中英

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. There are many doc and excel files that are uploaded to the server daily. i make these files to be downloaded. i want to implement the view as html feature and they should preserve the formatting also. so which tools can be used or it can be done through php only. (on php4)

Good luck.

These are a large set of undocumented and different formats, mostly based around 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.

Alternatively you might want to use OpenOffice to perform conversions - it can be scripted / called via mono interface.

HTH

C.

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

We do this using jodconverter which acts as a service utilizing openoffice. You can check for yourself, if openoffice exports with enough "preserveness". 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.

It´sa webservice that supports various formats of input (docx, doc, rtf, txt) and output (docx, doc, html, pdf, jpg, gif...).

It´s now part of the Zend Framework services .

For doc files, another alternative thats little simpler (but not as robust) to implement is Abiword. you can call the Abiword executable via commandline w/ parameters to convert the doc to HTML or other formats.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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