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.
I recommend wv (mentioned by symcbean) and 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´s a 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/