【发布时间】:2018-05-06 20:13:46
【问题描述】:
我的图片当前位于页面顶部,代码如下。我想通过在代码中添加marginTop=> 200 来降低图像的位置,但它不起作用。事实上,我已经尝试了我所知道的一切,但都失败了。有谁知道如何在phpword的标题中更改图像的位置?
$header = $section->addHeader();
$header->firstPage();
$header->addImage(
'../images/logo/AVA-Full-Logo-Grey.jpg',
array(
'width' => 250,
'wrappingStyle' => 'square',
'marginTop' => 200,
'positioning' => 'relative',
'posHorizontal' => PhpOffice\PhpWord\Style\Image::POSITION_HORIZONTAL_RIGHT,
'posHorizontalRel' => 'margin',
'posVerticalRel' => 'line',
)
);
【问题讨论】:
-
这个答案可能会有所帮助,我不想将其标记为重复,因为它没有可接受的答案。 stackoverflow.com/questions/29651259/… 从他们的文档看来,您的做法是正确的,phpword.readthedocs.io/en/latest/elements.html#images,也许有些东西会覆盖样式。