Forum


Replies: 3   Views: 680
Image url also getting printed in .docx file
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 RealTechs  · 03-11-2022 - 18:00

Hi,

I need a help when i am trying to add images in .docx file.

It got inserted in .docx file correctly bu having 2 issues as described below:

  • Whole image url gets printed where i set the placeholders in .docx file
  • Images are adding at the end of .docx file.and not where i placed placeholders

Here is the code i am using:

$options = array(
        'src' => $imageUrl,
        'imageAlign' => 'center',
        'scaling' => 50,
        'spacingTop' => 10,
        'spacingBottom' => 0,
        'spacingLeft' => 0,
        'spacingRight' => 20,
        'textWrap' => 0,
        'borderStyle' => 'lgDash',
        'borderWidth' => 6,
        'borderColor' => 'FF0000',
);

$docX->addImage($options);

Am i doing something wrong or missing something?

Thanks in advance for your help.

Harry