Forum


Replies: 2   Views: 3711
Images not appearing in document anymore after last update?
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 darren77  · 22-03-2013 - 17:00

Edit: it does work if I do not assign a template

I suddenly started to have this problem

I have a grid of images in my document, it has always worked and now suddenly I do not get any image

here is a code excerpt:

$paramsImg_first = array('name' => $image_first, //The image to be inserted

'scaling' => 35, //We scale them at 30% size

'spacingTop' => 10, //top padding

'spacingBottom' => 0, //bottom padding

'spacingLeft' => 0, //left padding

'spacingRight' => 10, //right padding

'jc' => 'left', 'textWrap' => 1//corresponding to square format

);

//parameters for second column image

$paramsImg_second = array('name' => $image_second, //The image to be inserted

'scaling' => 35, //We scale them at 30% size

'spacingTop' => 10, //top padding

'spacingBottom' => 0, //bottom padding

'spacingLeft' => 0, //left padding

'spacingRight' => 10, //right padding

'jc' => 'left', 'textWrap' => 1//corresponding to square format

);

//$paramsTable = array('TBLSTYLEval' => 'NormalTablePHPDOCX' , 'border' => 'single', 'border_spacing' => 1, 'border_color' => '000000');

$paramsTable = array('TBLSTYLEval' => 'NormalTablePHPDOCX', 'jc' => 'left');

//create table 2 rows 1 column for image and caption(defect)

$valuesTable = array(

//

array(

//

$this -> docx -> addElement('addImage', $paramsImg_first),

//

$this -> docx -> addElement('addImage', $paramsImg_second)

//

),

//

array($defect_first, $defect_second));

$this -> docx -> addTable($valuesTable, $paramsTable);

$this -> docx -> addBreak('line');

$this -> docx -> addBreak('line');

I also tried to dd the image with $this->docx->addImage($paramsImg_first) but no success

The log says nothing is wrong:

Open template wordocs/templates/LME/Audit App 3 Defects Photographed Appendix 3.docx.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Assign and replace text variable NO_PHOTOS_FOUND in template.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add break to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add break to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add text to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add break to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add break to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Create embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO New ID 17 . Embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add image uploads/c0808d56468c36f/0.jpg to DOCX.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add a new relationship related to image uploads/c0808d56468c36f/0.jpg .
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Create embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO New ID 18 . Embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add image uploads/c0808d56468c36f/1.jpg to DOCX.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add a new relationship related to image uploads/c0808d56468c36f/1.jpg .
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add table to Word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add break to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add break to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Create image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO New ID rId19 . Image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add image word/media/imgrId19.jpg.xml to DOCX.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Create embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO New ID 20 . Embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add image uploads/c0808d56468c36f/2.jpg to DOCX.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add a new relationship related to image uploads/c0808d56468c36f/2.jpg .
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Create embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO New ID 21 . Embedded image.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add image wordocs/images/placeholder.jpg to DOCX.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add a new relationship related to image wordocs/images/placeholder.jpg .
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Add table to Word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Embed HTML to word document.
2013-03-22T16:49:00+00:00 phpdocx_logger INFO Set DOCX name to: wordocs/reports/c0808d56468c36f/appendix_3.


Any suggestion???