Forum


Replies: 2   Views: 3628
Docx corrupt when adding png image
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 chokehold  · 12-02-2016 - 20:09

Hey

I have a problem with my docx generation. I have a template where i replace some variables and generate a docx document... That works fint..

As soon as i add an image word tells me that the files is corrupt. But letting Word correct the error gives me the document as i expect it to be. 

Im adding image like this...

$docx->addBreak(array('type' => 'page'));
                $options = array(
                'src' => $value['img_path'],
                'imageAlign' => 'center',
                'scaling' => 100,
                'spacingTop' => 10,
                'spacingBottom' => 0,
                'spacingLeft' => 0,
                'spacingRight' => 20,
                'textWrap' => 0,
                
                );
                $docx->addImage($options); 

 

Im lost here .. ? ..