Converting to .doc file using PHPdocx on Linux and Mac OS X

  • Aug 16, 2010

This information is outdated, please, refer to the PHPDocX Conversion plugin documentation for up to date info.
If you install PHPdocX in Mac OS X Server (10.4 or above) you could easily convert the .docx documents created using this command in a Shell Window:
textutil -convert doc /route/to/document_sample.docx
Texutil can convert also from doc to .docx (and html, rtf, odt and more formats)
textutil -convert docx /route/to/document_sample.doc
On Snow Leopard there is no man page for Texutil, so, you need to go to Apple, where there is more info about Textutil and how to use it.
You could batch the conversion of multiple files using a command; this is an example to convert files from .docx to .doc:
find . -name *.docx -exec textutil -convert doc '{}' \;
On Linux, you need to install the texutil package. Texutils can’t convert all elements from a .docx to a .doc file: you will loose images and graphics (piecharts and so), but tables (without colors) and formated text will be preserved.
But this not the only way to convert from .docx to .doc: there are more tricks … just wait for more info and new posts.