uncleronin Posted March 20, 2007 Share Posted March 20, 2007 Is it possible to edit a .doc file on linux? I know about doing it on Windows using COM but thats not much use on linux. Quote Link to comment Share on other sites More sharing options...
skali Posted March 20, 2007 Share Posted March 20, 2007 You are right you need COM to connect to word for manipulation and COM works on windows systems only. Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted March 20, 2007 Share Posted March 20, 2007 open office may be able to import it, change it and export back to a .doc. monk.e.boy Quote Link to comment Share on other sites More sharing options...
flappy_warbucks Posted March 20, 2007 Share Posted March 20, 2007 open office may be able to import it, change it and export back to a .doc. monk.e.boy I was just thinking that OpenOffice shoudl be able to open a .doc file quite easly. I have just updated some of the computers where i work, and due to lack of microsoft office keys, i have had to put Open Office on some of the machines, and they can open .doc files no problems. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted March 20, 2007 Share Posted March 20, 2007 yes, OpenOffice can open .doc files. but please tell us, what exactly does this have to do with PHP? Quote Link to comment Share on other sites More sharing options...
flappy_warbucks Posted March 20, 2007 Share Posted March 20, 2007 yes, OpenOffice can open .doc files. but please tell us, what exactly does this have to do with PHP? hahhahaha! You know that thought never occurred to me Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted March 20, 2007 Share Posted March 20, 2007 yes, OpenOffice can open .doc files. but please tell us, what exactly does this have to do with PHP? hahhahaha! You know thought that never occurred to me duh. Open office has automation (APIs) like word does. Word works through COM, I'm not sure about OOo, I think it can be scripted using Python (and maybe PHP) but you could set up a python script to import a .doc, search and replace, do other stuff, then export it. Call this python script from the PHP system() command. Check this out: http://www.newsforge.com/software/04/06/22/1926215.shtml, especially the last item - automation from other scripts. monk.e.boy Quote Link to comment Share on other sites More sharing options...
monk.e.boy Posted March 20, 2007 Share Posted March 20, 2007 Call this python script from the PHP system() command. That wasn't very helpful ;) So you'd create a HTML form with a file upload POST to a PHP page. Then in the PHP page move the tmp file. Then call the python script: system( './open-office-automation.py doc=./my_word.doc actions=action,list,here' ); then put a link to the new document. monk.e.boy Quote Link to comment Share on other sites More sharing options...
uncleronin Posted March 22, 2007 Author Share Posted March 22, 2007 >_< Python you say? Now that's a bugger - don't know anything about it! What is OOo and if it's open to python surely there must be a way to use the same wrapper thingy for php? Basically, PHP on linux = no easy way of manipulating .doc? Geh. My primary objective is to create and use a PHP script which takes an existing .doc file on the linux PC and edits it and emails it to the person performing whatever action. You can guess that this is web driven. The contents of the .doc depend on the user and the page. In any case, since the user doesn't actually upload any .doc's I've decided to just use .rtf *nods* and edit it like normal text docs. As a matter of interest - what does this python .doc script thing look like? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.