当我使用addText()它时align=center,左,右工作正常,但当我尝试使用align=justify脚本工作没有问题,但当我尝试打开.docx文件时,它给我错误,文件没有打开.
如果有人知道解决方案,将不胜感激.
$text = "some text";
$PHPWord->addFontStyle('r2Style', array('bold'=>false, 'italic'=>false, 'size'=>12));
$PHPWord->addParagraphStyle('p2Style', array('align'=>'center', 'spaceAfter'=>100));
$section->addText($text, 'r2Style', 'p2Style');
Run Code Online (Sandbox Code Playgroud) phpword ×1