Replies: 1   Views: 3361
Replaceheaderimage & addtemplateimage
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 concentric  · 13-11-2012 - 17:36

Hello ,

I tried both methods in my template,but the image doesn’t get replaced by anything though.

$docx = new CreateDocx();
$customerImageL = $customer->Id.'.jpg';

$docx->replaceHeaderImage('CustomerLogo', '../../templates/'.$customerImageL);

I set the Alt Text as $CustomerLogo$ in my template.

given below the log file

11/13/12 11:03:14,304 [4712] INFO phpdocx_logger - Create a temp file to use as initial ZIP file. DOCX is a ZIP file.
11/13/12 11:03:14,496 [4712] INFO phpdocx_logger - The language has been set.
11/13/12 11:03:14,523 [4712] INFO phpdocx_logger - Open template ../../templates/Template.docx.
11/13/12 11:03:14,527 [4712] INFO phpdocx_logger - Assign and replace image variable CustomerLogo in header.

Additionally, I tried to use your image example and it worked, so it is not a server problem