Hello,
This post is more than year old, and a lot changes were done to the library since the release of phpdocx 4.
For example the js was removed, and now you must use the textAlign parameter. Please take a look at the included examples and the documentation available on:
http://www.phpdocx.com/api-documentation/word-content/add-paragraph-text-Word-document-with-PHP
Regards.