我想要右边的图片,左边的文字围绕着图片 float 。反过来效果很好,在 Recipies section in the documentation 上也有一个例子.但是,我没有使用漂浮在右侧的图像来实现这一点。我尝试了什么:
addImage('myimage.png',
array(
'width'=>320,
'height'=>240,
'align'=>'right',
'wrappingStyle'=>'square',
'positioning' => 'absolute'
)
);
或
addImage('myimage.png',
array(
'width'=>320,
'height'=>240,
'align'=>'right',
'wrappingStyle'=>'square',
'positioning' => 'absolute',
'posHorizontalRel' => 'margin',
'posVerticalRel' => 'line'
)
);
我还尝试了负图像宽度等,但这也没有用。不幸的是,整个项目的文档真的很差,至少在phpword.readthedocs.org。 .
最佳答案
我也遇到了同样的问题,目前网上还没有答案。所以这就是我想出的:
$section->addImage('image.png', array(
'width' => 40,
'height' => 40,
'wrappingStyle' => 'square',
'positioning' => 'absolute',
'posHorizontal' => \PhpOffice\PhpWord\Style\Image::POSITION_HORIZONTAL_RIGHT,
'posHorizontalRel' => 'margin',
'posVerticalRel' => 'line',
));
关于php - 在 PhpWord 中创建右浮动图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34286454/