News

Add an image and give it some format in PHPdocx

  • May 03, 2011

This information is outdated, please, refer to the addImage documentation for up to date info.
Almost every docx document have one or more images, for artistic, informative or other purposes.
Add an image is easy: you only need define the parameters and pass it to addImage like this:


require_once '../../classes/CreateDocx.inc';

$docx = new CreateDocx();

$paramsImg = array(
'name' => '../files/img/image.png',
'scaling' => 50,
'spacingTop' => 100,
'spacingBottom' => 0,
'spacingLeft' => 100,
'spacingRight' => 0,
'textWrap' => 1,
'border' => 1,
'borderDiscontinuous' => 1
);

$docx->addImage($paramsImg);

$docx->createDocx('example_image');