this could help you
<?php // htmlviewer.php // convert a Word doc to an HTML file //$DocumentPath = str_replace("\\", "\", $DocumentPath); $DocumentPath="C:/Archivos de programa/Easyphp/www/subidas/curric.doc"; // create an instance of the Word application $word = new COM("word.application") or die("Unable to instantiate application object"); // creating an instance of the Word Document object $wordDocument = new COM("word.document") or die("Unable to instantiate document object"); $word->Visible = 0; // open up an empty document $wordDocument = $word->Documents->Open($DocumentPath); // create the filename for the HTML version $HTMLPath = substr_replace($DocumentPath, 'txt', -3, 3); // save the document as HTML $wordDocument->SaveAs($HTMLPath, 3); // clean up $wordDocument = null; $word->Quit(); $word = null; // redirect the browser to the newly-created document header("Location:". $HTMLPath); header("Location:". $HTMLPath); ?>
It's good script but I need do something like that WITHOUT USE COM objects. Site with this script is hosting by Linux provier
I am new in php and same problem i am facing in conversion.
I want to convert .doc/.docx/.rtf file to .txt or .html format.
i am using linux server so preferably can't choose COM component.
Can any one help me out. ITs urgent.
thanks in advance.
Edited 5 Years Ago by bhmb2000: n/a
This comes up on a fairly regular basis and I don't think that anyone has identified a really good solution. There are one or two (PHP) programs that attempt to convert from Doc to text but they aren't 100% accurate. It can be done with COM but that doesn't help you on Linux. You could do it as a local program (with COM) rather than as a server-based program. In that case you would do the conversion and the upload from the user end. This is very "do-able" but has the obvious inconvenience for the user of having to download the program. A program like that could be done quite easily using Autoit.
Other ways at it could be:
* Convert it to PDF (using the Zend conversion tool) and store / display that.
* Have the user upload something other than a .doc file (e.g. RTF) that you may be able to interpret more easily. You could also have them save from Word into html directly but the output is a terrible jumble that you wouldn't want to deal with.
* Possibly try to incorporate Open Office components that might be able to do this.
* Just leave it as a Doc file and save / display that.
I have the same problem: works on local but not on linux server.
IS there anyone who found solution for this??
just got the solution.
see the link http://www.wagner.pp.ru/~vitus/software/catdoc/
If you are a Linux/Ubuntu user then
1]just download the catdoc-0.94.2.tar.gz file. Extract it.
2]Go to terminal and go to extracted directory.
sudo make install
(Hope that it will get instlled!!!)
4]if installation is successful then try command man catdoc.
(It should give you manual of catdoc)
5]Now just do
6] If want its output in another text file the
catdoc <file_name.doc> > xyz.txt
Hope it works.
because it worked for me.
Please let me know if am wrong.
That is very good alternative solution, who only needs to read "textual" data.
We have several pdf/doc files/ We need to convert them into html pages. Kindly write a php code for it. You need to get a third party library for it.
Output - a html page with given name in the given directory
plzz solve my problam
This forum is not a problem solving service.
If you have problems coding this, post what you have, clearly explain your issue and you will get help.
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi Daniweb Community,
I'm having a small problem. I am unable to get the size of an uploaded file from the server to run a max size check. When I use the following command as specified in any example of file upload I can find on the web:
if ($_FILES["r_recommend"]["size"] ...
I have a code on excel, that will count the critera if there is more than one box filled out.
But now i am converting this code to jquery and i cannot figure it out.
on my page, there is a toggle button, yes/no selector for autopay, ...