我的左侧有一个徽标,标题右侧有文字。这几乎是完美的,但我无法获得文本出现在页面顶部;它显示大约在左下方的徽标中显示的徽标。
我已经玩过所有文本参数 - 空间,凹痕,之前和之后 - 无济于事。有什么想法吗?
我的代码是:
$section = $phpWord->addSection();
$header = $section->addHeader();
$header ->addImage('logo.png',
array(
'width' => 200,
'height' => 80,
'wrappingStyle' => 'square',
'positioning' => 'absolute',
'posHorizontalRel' => 'margin',
'posVerticalRel' => 'line',
)
);
$header->addText(
'Company Name, Address blah blah
Blah blah blah blah blah blah blah',
array('bold' => true),
array(
'space' => array('before' => 2, 'after' => 500),
'indentation' => array('left' => 4500, 'right' => 10)
)
);
仅在标题内使用表?使用这样的东西(OFC,将单元大小调整为与徽标大小匹配的东西):
$section = $phpWord->addSection();
$header = $section->addHeader();
$table = $header->addTable();
$table->addRow();
$table->addCell(4500)->addImage('logo.png',
array(
'width' => 200,
'height' => 80,
)
);
$table->addCell(4500)->addText(
'Company Name, Address blah blah Blah blah blah blah blah blah blah',
array('bold' => true)
);