Forum


Replies: 1   Views: 2562
Center image using replacevariablebywordfragment
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 Adam Steff  · 29-04-2018 - 07:13

Hello, I've recently purchased the Premium package and I'm working with templates.

I've been trying center an image using replaceVariableByWordFragment, is that possible?

Also I've havn't been able to get replacePlaceholderImage working.

These are the steps I've been following:

  1. Right Click on image and select 'Add Alt Text'
  2. Add the value $IMAGE$ to the Alt Text Title
  3. Then I run this code $docx->replacePlaceholderImage('IMAGE',$to_folder_path.'/'.$file_name, ['target'=>'document']);

Any help would be appreciated.

$docx->replacePlaceholderImage('IMAGE',$to_folder_path.'/'.$file_name, ['target' => 'document']);