Jump to content

Editting a .doc file on linux


uncleronin

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

>_< 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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.