If you are using addhtml() for generating a .docx file, you must remember that PHPdocX is very smart, but Word don’t understand things like “medium” or “big”.
Code like this:
<p>This will insert the name in the document: <strong><span style="font-size: medium;">The Name</span></strong></p>
Will be no rendered. You must specify the font size as pixels on font-size’s tag like this:
<p>This will insert the name in the document: <strong><span style=" font-size: 12px;”>The Name</span></strong></p>
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.
If you want to install you license of PHPDocX in your server, remember that the domain must be the same that you use when register the software: you can’t use a subdomain because the verification included with you copy will search only for the original domain you registered. You need to buy one copy for each subdomain if you want to use PHPDocX on them. Read the rest of this entry »