I added two logos using php word but both logos are not on the same line:
I want both logos to be on the same line like below:
Where's my mistake?
if (file_exists($logo)) {
$table->addRow();
// $table->addCell(20000, array('bgColor' => 'ffffff', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0), $fontStyleIndexParaTitle)->addImage($logo, array('align' => 'center'));
$table->addCell(20000, array('bgColor' => 'ffffff', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0 ), $fontStyleIndexParaTitle)->addImage($logo, array('align' => 'left','width' => 70, 'height' => 70,));
}
if (file_exists($logo2)) {
$table->addRow();
// $table->addCell(20000, array('bgColor' => 'ffffff', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0), $fontStyleIndexParaTitle)->addImage($logo, array('align' => 'center'));
$table->addCell(20000, array('bgColor' => 'ffffff', 'spaceBefore' => 0, 'spaceAfter' => 0, 'spacing' => 0 ), $fontStyleIndexParaTitle)->addImage($logo2, array('align' => 'right', 'width' => 130));
}
If one or both of the files exist, you only want to add a single row, so try this:
Edit: This code (using
phpoffice/phpword
v0.16.0):Produces this Word document (my sample images are just solid colored rectangles):