I need to align the logo and text side by side. But when creating a dictionary document, the text always appears under the logo. I tried the solution indicated here:
http://phpword.codeplex.com/discussions/232684
But that did not work for me. Here is what I tried (solution not mentioned above)
$section = $PHPWord->createSection();
$image = $section->addImage('_mars.jpg',array ('width'=>100));
$table = $section->addTable();
for($r = 1; $r <= 1; $r++) {
$table->addRow();
for($c = 1; $c <= 1; $c++) {
$table->addCell(1750)->addText("Row $r,Cell ".
$section->addImage('_mars.jpg',array('width'=>100)));
}
}
and I get this error in
$section->addImage() partCatchable fatal error: Object of class PHPWord_Section_Image could not be converted to string in
Can someone tell me how can I add an image to a table cell?
source
share