Forum


Replies: 6   Views: 4089
Getting image captions to work?
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by nicks  · 15-01-2016 - 12:02

Hi,

I've installed the latest release and trying to get to grips with image captions.

I've added a 'caption' parameter as shown below:

$captionsettings = array('text' => 'test');
$image->addImage(array('src' => $imagesrc,'imageAlign' => 'center','height' => $picvar[0],'width' => $picvar[1],'caption' => $captionsettings));

 

Though I then receive the error:

Fatal error: Call to a member function saveXML() on a non-object in /var/www/phpdocx_corporate-new2/classes/CreateDocx.inc

There is mention of:

'show_label' (string) show default value Figure

I tried setting a value here, though I guess it provides a default?

Is it possible to get demo snippet of how I should declare a caption?

Thanks