Replies: 2   Views: 3411
Justified center not working in pro version
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by kshaikh  · 28-07-2013 - 12:09


The justified center option isn't working in the following code:


require_once '../phpdocxpro/classes/';


$docx = new CreateDocx();

$paramsText = array(

    'font' => 'Times New Roman', 'sz' => '10'


$text = array();

$text[] =


            'text' => 'I am going to write', 

            'sz' => '13',

            'jc' => 'center',

            'b' => 'on'


$docx->addText($text, $paramsText);




Please advice.



Posted by admin-phpdocx  · 29-07-2013 - 09:22

The justification is a paragraph wide property and following your notation it should go with the paramasText parameter like that:

$paramsText = array(

    'font' => 'Times New Roman', 'sz' => '10', 'jc' => 'center');

as explained in the addText API documentation.