Forum


Replies: 6   Views: 4248
Addimage not doing anything
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 aemka  · 11-05-2011 - 12:53

Hi Forum,

I'm just giving the free version of phpdocx a first try. First problem I encountered was, that addImage does not seem to work. So far I did the following:

require_once (PATH_site . 'typo3conf/ext/payment/lib/phpdocx/classes/CreateDocx.inc');
$docx = new CreateDocx();

$paramsImg = array(
#'name' => 'http://maps.google.com/maps/api/staticmap?path=color:0xff0000ff|weight:5|40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397&size=512x512&sensor=false',
#'name' => PATH_site . 'typo3conf/ext/payment/res/staticmap.png',
'name' => '../../typo3conf/ext/payment/res/staticmap.png',
'scaling' => 50,
'spacingTop' => 0,
'spacingBottom' => 0,
'spacingLeft' => 0,
'spacingRight' => 0,
'textWrap' => 1,
'border' => 0,
'borderDiscontinuous' => 1,
);
$docx->addImage($paramsImg);

$docx->createDocx(PATH_site . 'typo3conf/ext/payment/res/example_text');

The path to the image is right in all above versions. (is_readable() says TRUE)
I tried the URL - result php dies with no error shown even though display_errors is on and error_reporting is at E_ALL.
I tried the absolute path - no image inserted.
I tried the relative path - no image inserted.

Here is the output: http://www.aviation-broker.com/typo3conf/ext/payment/res/example_text.docx
Here is the image: http://www.aviation-broker.com/typo3conf/ext/payment/res/staticmap.png

Any suggestions?

http://www.aemka.de/