Categories > OpenTBS with DOCX >

insert image with path url in Docx

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Fati
Date: 2014-04-24
Time: 15:43

insert image with path url in Docx

How can I change the picture with another picture of website ?

I have code :
In  a docx file
[b.image;ope=changepic;from=[val];default=current;adjust]
and my code php is
$data = array('image'=>'http://palina.p.a.pic.centerblog.net/hb5yvh6a.jpg');
$document->MergeField('b', $data);
i don't have any error but image is not changed

thanks



By: Skrol29
Date: 2014-04-24
Time: 22:15

Re: insert image with path url in Docx

Hi,

The image file must be local.
By: Fati
Date: 2014-04-25
Time: 10:09

Re: insert image with path url in Docx

I use Symfony Framework 2.3
i tested with symfony url path
$data = array('image'=>$this->getRequest()->getUriForPath('/uploads/image1.png'));
$document->MergeField('b', $data);

and with local path

$data = array('image'=>'/images/image1.png');
$document->MergeField('b', $data);

in my site these picture appear well  but not in docx file
By: Skrol29
Date: 2014-04-27
Time: 01:13

Re: insert image with path url in Docx

'/images/image1.png' is the path for the navigator, but the file must be local for the server. It must be a path as a file on the server.
By: Fati
Date: 2014-04-28
Time: 09:57

Re: insert image with path url in Docx

Yes it works Thank you :)