Justified Text

Mar 26, 2012 at 9:34 AM

Hi,

I am getting an error when attempting to set text to be justified:

$PHPWord->addParagraphStyle('pJustify', array('align' => 'justify', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0));

Has anyone else managed to get justified text?

Many thanks

Jul 1, 2012 at 8:49 AM
Edited Jul 1, 2012 at 9:02 AM

Hi,

This post is a bit old and i'm sure you finally found a solution, but it might help someone :

try :

$PHPWord->addParagraphStyle('pJustify', array('align' => 'both', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0));

instead of :

$PHPWord->addParagraphStyle('pJustify', array('align' => 'justify', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0));