如何通过phpword对齐段落中心?

如何通过phpword对齐段落中心?,php,phpword,Php,Phpword,我在我的项目中使用phpword插件创建word文件,但我有一个问题,那就是段落没有对齐中心,例如: 但我想要这样: 我该怎么办 $textrun = $section->createTextRun(array('widowControl'=>'true')); $textrun->addText('There is a',array('size'=>13)); $textrun->addImage('563803062838d1446511366.gif');

我在我的项目中使用phpword插件创建word文件,但我有一个问题,那就是段落没有对齐中心,例如:

但我想要这样:

我该怎么办

$textrun = $section->createTextRun(array('widowControl'=>'true'));
$textrun->addText('There is a',array('size'=>13));
$textrun->addImage('563803062838d1446511366.gif');

没有承诺,但这会给你一些你“玩”的价值观

$textrun->addImage(
    '563803062838d1446511366.gif',
    array(
        'width' => 100, //set to match image
        'height' => 100, //set to match image
        'marginTop' => 5, //my guess play with this value
        'marginLeft' => 0,
        'wrappingStyle' => 'behind'
    )
);

你也可以考虑在图像中添加空白来操纵它的位置

你能粘贴用于生成单词的代码吗?有多种选择,你没有帮助我们帮助你我的意思是,我使用你给我的代码来创建图像,但它也没有对齐中心。