如何在phpword的标题部分添加左右两张图片?

时间:2019-08-08 06:07:35

标签: php phpword

我正在尝试在标头部分中在左侧和右侧两个位置添加两个图像,但这不起作用

$section = $phpWord->addSection();
// Add first page header
$header = $section->addHeader();
$header->firstPage();
$table = $header->addTable();
$table->addRow();
$cell = $table->addCell(4500);
$textrun = $cell->addTextRun();
$textrun->addText('This is the header with ');
$textrun->addLink('https://github.com/PHPOffice/PHPWord', 'PHPWord on GitHub');
$table->addCell(4500)->addImage('resources/PhpWord.png', array('width' => 80, 
                                                               'height' => 80, 
                                                                'alignment' => \PhpOffice\PhpWord\SimpleType\Jc::END));

我该怎么办?

0 个答案:

没有答案