Fixed broken paragraph alignment for OpenXml.

This commit is contained in:
Roman Syroeshko 2015-03-01 21:13:03 +04:00
parent 17ee9e1bf8
commit 18c54623b0
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ include_once 'Sample_Header.php';
echo date('H:i:s') , ' Create new PhpWord object' , EOL; echo date('H:i:s') , ' Create new PhpWord object' , EOL;
$phpWord = new \PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16, 'allCaps' => true, 'doubleStrikethrough' => true)); $phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16, 'allCaps' => true, 'doubleStrikethrough' => true));
$phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100)); $phpWord->addParagraphStyle('pStyle', array('alignment' => 'center', 'spaceAfter' => 100));
$phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240)); $phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240));
// New portrait section // New portrait section

View File

@ -6,7 +6,7 @@ echo date('H:i:s'), ' Create new PhpWord object', EOL;
$phpWord = new \PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->setDefaultParagraphStyle( $phpWord->setDefaultParagraphStyle(
array( array(
'align' => 'both', 'alignment' => 'both',
'spaceAfter' => \PhpOffice\PhpWord\Shared\Converter::pointToTwip(12), 'spaceAfter' => \PhpOffice\PhpWord\Shared\Converter::pointToTwip(12),
'spacing' => 120, 'spacing' => 120,
) )