Register Lost your password?
Full api documentation: full api documentation FREE version full api documentation PRO version

public function addImage(array paramsImg)

Parameters

$paramsImg

  • ‘name’ (image path) : ‘img/image.png’, …
  • ’sizeX’ (image width) : 1000, …
  • ’sizeY’ (image height) : 1000, …
  • ’spacingTop’ (spacing top) : 100, …
  • ’spacingBottom’ (spacing bottom) : 100, …
  • ’spacingLeft’ (spacing left) : 100, …
  • ’spacingRight’ (spacing right) : 100, …
  • ‘textWrap’ (text wrap): 0 (inline) , 1 (square), 2 (front), 3 (back), 4 (top and bottom), 5 (clear)
  • ‘jc’ (aligment) : right, center
  • ‘border’ (border size) : 1,2,3 …
  • ‘borderDiscontinuous’(border discontinuous) : 0, 1
  • ’scaling’ (% of size) 50, 100…
  • ‘font’ (A specific size and style of font type within a type family. Example ‘Times New Roman’, ‘Arial’,…)

Examples

Example 1


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');

    2 Responses

  • thetaylor82

    Does the image have to be a png?

  • thetaylor82

    Ignore that, I spotted on the page above the more file formats are supported

Your comments